手机
当前位置:查字典教程网 >脚本专栏 >linuxshell >linux 监视端口是否正常的shell脚本
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脚本

Linux shell脚本基础学习详细介绍(完整版)第1/2页

nginx日志切割shell脚本

8个实用的Shell脚本分享

linux中shell脚本实现下载完关机

又拍云存储同步脚本

使用iconv批量改变文件编码的shell脚本

linux shell脚本学习xargs命令使用详解

linux中批量修改文件名的脚本代码

Ubuntu服务器配置apache2.4的限速功能shell脚本分享

精品推荐
分类导航