vi 502.sh- #!/bin/bash

  • if [[ curl -s http://74.117.58.41/p.php| grep 502 == "502" ]]; then
  • /etc/init.d/php-fpm restart
  • fi复制代码chmod +x *.sh

crontab -e
每2分钟检查一次
/2 * 502.sh

欢迎大家改进,或者指出缺点,提出更好的方案..
临时改进的代码,目的在于抛小鱼,引大猫..

正确版本:http://www.hostloc.com/thread-54176-1-1.html

[ 本帖最后由 Cat 于 2011-4-8 21:08 编辑 ]