上一篇: ping发现掉包报警shell
监视端口是否正常的shell
[ 2009/04/20 16:26 | by selboo ]
#!/bin/bash
port=”80″
restart=”/etc/init.d/httpd restart”
EMAIL=”/bin/echo selboo | mutt -s "重新启动httpd" root@selboo.com.cn”
netstat -ln |awk ‘/^tcp/ {print $4}’ |grep -q “:$port$” || {
#reboot httpd
eval $restart;$EMAIL
exit $?
}
exit 0
最后编辑: selboo 编辑于2009/04/20 16:27