shell校验某个端口是否启动

port=`lsof -i:8080 | wc -l`
if [ "$port" -eq "0" ];then
      echo "未启动"
else
      echo "已经启动" 
fi
posted @ 2020-12-10 14:44  cchilei  阅读(902)  评论(0)    收藏  举报