文章编辑人员:雪舞
内容测试时间:2023-5-9 02:16:53
测试环境:CentOS 7.6
测试版本:新武侠世界
游客,本帖隐藏的内容需要积分高于 500 才可浏览,您当前积分为 0
最近修改版本:
#!/bin/bash
ulimit -n 65535
# 删除已有的计划任务
sed -i '/listenServer.sh/d' /var/spool/cron/root
echo '__ ___ _ _______ ___ _ _ _
\ \/ / | | | ____\ \ / / | | | ___| |_ __ _ _ __| |_
\ /| | | | _| \ \ /\ / /| | | | / __| __/ _ | |__| __|
/ \| |_| | |___ \ V V / | |_| | \__ \ || (_| | | | |_
/_/\_\\___/|_____| \_/\_/ \___/ |___/\__\__,_|_| \__|'
if ps aux | grep -w "./ShareMemory" | grep -v grep >/dev/null 2>&1; then
echo " ShareMemory is running !!!!!!"
else
###### start ShareMemory ######
cd /home/tlbb/Server/
./shm clear >/dev/null 2>&1
rm -rf exit.cmd quitserver.cmd
./shm start >/dev/null 2>&1
echo " start ShareMemory ......"
# 输出进度条
for i in {1..30}; do
equals=$(printf "%0.s=" $(seq 1 $((i*2))))
spaces=$(printf "%0.s " $(seq 1 $((60-i*2))))
printf "[%s>%s] %d%%\r" "$equals" "$spaces" "$((i*100/30))"
sleep 1
done
echo -e "\n ShareMemory started completely !!!!!!"
###### start World ######
cd /home/tlbb/Server/
./World >/dev/null 2>&1 &
echo " start World ......"
# 输出进度条
for i in {1..5}; do
equals=$(printf "%0.s=" $(seq 1 $((i*4))))
spaces=$(printf "%0.s " $(seq 1 $((20-i*4))))
printf "[%s>%s] %d%%\r" "$equals" "$spaces" "$((i*100/5))"
sleep 1
done
echo -e "\n World started completely !!!!!!"
###### start Login ######
./Login >/dev/null 2>&1 &
echo " start Login ......"
sleep 1
echo -e " Login started completely !!!!!!"
###### start ServerTest ######
cd /home/tlbb/Server/
if [[ "$1" == "-r" ]]; then
nohup ./ServerTest &> /dev/null &
else
nohup ./ServerTest -loadscriptonce &> /dev/null &
fi
echo " start Server ......"
# 输出进度条
for i in {1..60}; do
equals=$(printf "%0.s=" $(seq 1 $((i*2))))
spaces=$(printf "%0.s " $(seq 1 $((120-i*2))))
printf "[%s>%s] %d%%\r" "$equals" "$spaces" "$((i*100/60))"
sleep 1
done
if [[ "$1" == "-r" ]]; then
echo -e "\n Server started completely !!!!!!
+----------------------------------------------------------------------
| TLBB Server 热更新已开启
+----------------------------------------------------------------------"
else
echo -e "\n Server started completely !!!!!!
+----------------------------------------------------------------------
| TLBB Server 热更新已关闭 若想开启请加启动参数 ./run -r
+----------------------------------------------------------------------"
fi
# 创建监听计划任务
sh /home/tlbb/listenServer.sh
echo " ------------listenServer started------------"
fi
|