- #!/bin/bash
- #截取httped进程,并把结果赋予变量test
- test=$(ps -aux | grep "httpd" | grep -v "grep")
- #如果test的值不为空,则执行then中命令
- if [ -n $"test" ]
- then
- echo "$(date) httped is ok!" >> /tmp/autostart-acc.log
- else
- /etc/rc.d/init.d/httpd start &> /dev/null
- echo "$(date) restart httpd !" >> /tmp/autostart-err.log
- fi
posted @
2021-08-07 13:42
葛老头
阅读(
97)
评论()
收藏
举报