#!/bin/bash
Apache_Status=`nmap -sT 10.0.0.121 | grep tcp | grep http | awk '{print $2}'`
if [ Apache_Status=="open" ];then
echo "`date` httpd id ok!" >> /tmp/apache_status.log
else
/etc/rc.d/init.d/httpd start &>/dev/null
echo "`date` restart httpd server!!" >> /tmp/apache_err_status.log
fi
shell脚本之判断http服务是否正常
原创
©著作权归作者所有:来自51CTO博客作者一程的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:shell脚本之判断文件类型

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章