0
点赞
收藏
分享

微信扫一扫

shell监控php是否挂了502 ,并重启php

金牛豆豆 2023-02-15 阅读 72


#!/bin/bash

CheckURL="http://xx"

STATUS_CODE=`curl -o /dev/null -m 10 –connect-timeout 10 -s -w %{http_code} $CheckURL`

#echo "$CheckURL Status Code:\t$STATUS_CODE"

if [ "$STATUS_CODE" = "502" ]; then

lnmp php-fpm restart

fi

保存:

​​502.sh​​

* * * * * sh /www/sh/502.sh >> /www/log/crontab.log 2>1


举报

相关推荐

0 条评论