shellExam

[TOC]

restart.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CNT=$(ps -ef |grep hoyoGameMgr_unix |grep -v grep|wc -l)
echo "detected " $CNT " instance"
if [ "$CNT" -lt 1 ] ; then
echo "Not Run Yet"
else
echo "has one"
# 不停机重启动
pkill -HUP hoyoGameMgr_unix
exit 0
fi

echo "start at "`date` >> restart.log
nohup ./hoyoGameMgr_unix > out.log 2> err.log &
echo "after start"
ps -ef |grep hoyoGameMgr_unix |grep -v grep