14 lines
287 B
Bash
14 lines
287 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 servicie not exist"
|
|
nohup ./hm_server > server.log 2>&1 &
|
|
fi
|
|
sleep 60
|
|
done
|