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
原文地址:https://www.cnblogs.com/effortsing/p/10108307.html