linux 监视端口是否正常的shell脚本
摘要:复制代码代码如下:#!/bin/bashport=”80″restart=”/etc/init.d/httpdrestart”EMAIL=”...
复制代码 代码如下:
#!/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
【linux 监视端口是否正常的shell脚本】相关文章:
下一篇:
并发数据库压力测试的shell脚本代码