launch-s.sh 发布脚本备份

[root@izm5ef2ow9zssfxi6opoucz code]# cat launch-s.sh 

serverId=1313
zipName=$1
serverPath='code-s'$serverId

if [ ! $zipName ]; then  
   echo -e "\033[31mplease enter zipName...\033[0m"
   exit 10
fi

echo -e "\033[32mstop server... \033[0m"
ps -ef | grep 's'$serverId | grep -v grep | grep -v launch
ps -ef | grep 's'$serverId | grep -v grep | grep -v launch |awk '{print $2}'
ps -ef | grep 's'$serverId | grep -v grep | grep -v launch |awk '{print $2}' | xargs kill -9
screen -wipe

echo -e "\033[32menter server path...\033[0m"
cd ~/data/$serverPath
pwd
rm -rfv $zipName

echo -e "\033[32mdownload zip...\033[0m"
wget http://12.1.40.15:90/data/code/$zipName

echo -e "\033[32mdeploy server...\033[0m"
sh deploy.sh $zipName

echo -e "\033[32mstart server...\033[0m"
cd publish_codex
pwd
sh run-world.sh
sh run-log.sh
sleep 1
sh run-game.sh
cd ~

[root@izm5ef2ow9zssfxi6opoucz code]# 

 

posted @ 2019-09-10 23:52  会飞的斧头  阅读(303)  评论(0编辑  收藏  举报