game2005/server/bin/restart.sh
aozhiwei 9fad4f67b3 1
2020-10-28 13:06:03 +08:00

17 lines
298 B
Bash
Executable File

#!/bin/bash
source /etc/profile
source /root/.bash_profile
pid=$(ps -ef|grep "gameserver2005 -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 ./gameserver2005 -n $2 -i $1 >> gameserver2005$2_$1.out &