检验端口是否存在:
[shell]centos下shell检测端口是否存在
https://yq.aliyun.com/articles/576481
shell脚本:
#!/bin/bash
success=1
while [ $success -gt 0 ]
do
sleep 9
a=`netstat -l | grep 9091`
if [ "$a" ];then
success=0
echo "成功启动"
else
echo "restart..."
./start.sh
fi
done