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

 

posted @ 2018-12-12 14:47  effortsing  阅读(7425)  评论(0编辑  收藏  举报