diff --git a/server/bin/restart.sh b/server/bin/restart.sh index 7d3ed21..152f905 100755 --- a/server/bin/restart.sh +++ b/server/bin/restart.sh @@ -1,5 +1,16 @@ #!/bin/bash -python manage.py restart $1 $2 +source /etc/profile +source /root/.bash_profile -echo 'success' +pid=$(ps -ef|grep "gameserver2001 -n $2 -i $1"|grep -v grep|awk '{print $2}') +echo $pid + +if [[ $pid != "" ]] +then + echo $pid|xargs kill -9 +else + echo "pid 为空" +fi + +nohup ./gameserver2001 -n $2 -i $1 >> gameserver2001$2_$1.out &