网站状态异常时自动重启php-fpm的shell脚本
2016-06-23 18:58
881 查看
#!/bin/bash
resp=$(curl -Is http://jsonaz.com/|grep "502 Bad Gateway")
if [ "$resp" = "" ]
then
echo "good"
else
$(sudo kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`)
fi
resp=$(curl -Is http://jsonaz.com/|grep "502 Bad Gateway")
if [ "$resp" = "" ]
then
echo "good"
else
$(sudo kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`)
fi
相关文章推荐
- Linux系统下,项目部署。【SSH Secure Shell Client】【常用命令】
- bash的算术运算(整理中)
- Linux Shell及常用命令简介
- uboot 准备阶段
- 清除日志shell脚本
- shell脚本编写,实现爬虫挂掉后重启
- Bash读取文件每一行内容
- shell脚本 grep重点详解 使用场景
- shell的特性之十:输入输出重定向和管道
- Powershell 中的比较运算符
- powershell读写磁盘变量(对象序列化)
- logcat抓取日志
- Linux中shell提示符定制
- 常用shell
- [sh]shell命令缩写
- [shell]bash-parallel
- shell 套用expect
- Shell替换:Shell变量替换,命令替换,转义字符
- Shell特殊变量:Shell $0, $#, $*, $@, $?, $$和命令行参数
- shell变量