This commit is contained in:
aozhiwei 2020-10-28 13:06:03 +08:00
parent 6333ac8ad4
commit 9fad4f67b3
4 changed files with 40 additions and 0 deletions

11
server/bin/monitor.sh Normal file
View File

@ -0,0 +1,11 @@
path_arr=$(echo $PWD|tr '/' '\n')
path_arr=(${path_arr})
GAME_ID=${path_arr[-5]}
if echo $GAME_ID | grep -q '[^0-9]'
then
echo 'game_id参数必须为数字'
exit 1
fi
python ../../third_party/tools/scripts/server/monitor.py gameserver${GAME_ID} '-n1 -i1'

View File

@ -0,0 +1,10 @@
#!/bin/bash
source /etc/profile
source /root/.bash_profile
./gameserver2005 -n $1 -i $2 >> gameserver2005$2_$1.out
echo $? >> start.log
date >> start.log
echo $1 $2 >> start.log
free -m >> start.log

16
server/bin/restart.sh Executable file
View File

@ -0,0 +1,16 @@
#!/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 &

3
server/bin/start_instance.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
nohup sh real_start_instance.sh 1 1 2>&1 &