mh_server/pack/examine.sh
2023-05-09 11:37:56 +08:00

14 lines
286 B
Bash

#!/bin/bash
while : #循环,为了让脚本一直运行监控
do
COUNT=`ps -ef | grep ./hm_server |wc -l`
if [ "$COUNT" -gt 1 ];
then
echo "server service is ok"
else
echo "server service not exist"
nohup ./hm_server > server.log 2>&1 &
fi
sleep 60
done