shell脚本判断端口是否打开
[root@www zabbix_scripts]# cat check_httpd.sh #!/bin/bash a=`lsof -i:80 | wc -l` if [ "$a" -gt "0" ];then echo "0" else echo "1" fi
[root@www zabbix_scripts]# cat check_httpd.sh #!/bin/bash a=`lsof -i:80 | wc -l` if [ "$a" -gt "0" ];then echo "0" else echo "1" fi