监测进程,端口是否存在,重启某服务,这是农民世界API接口脚本
#! /bin/bash time=$(date "+%Y-%m-%d %H:%M:%S") PORT=1000 ProcNumber=`lsof -i:$PORT|wc -l` if [ $ProcNumber -le 0 ];then ...
#! /bin/bash time=$(date "+%Y-%m-%d %H:%M:%S") PORT=1000 ProcNumber=`lsof -i:$PORT|wc -l` if [ $ProcNumber -le 0 ];then ...