centos7.x中shell文件检测某端口及定时执行任务
#!/bin/bashrecvq=`netstat -lntp |grep 10080|awk '{print $2}'`if [ $recvq == "0" ] ;thenecho "10080 ok"game=`netstat -lntp | grep -c 9001`if [ $game == "1" ] ;thenecho "9001 ok"elserebootfielse/root/fastcgi_rest