代码拉取完成,页面将自动刷新
#!/bin/bash
# 想要关闭的target
target=$1
# 配置文件
config_file=config/config.${target}.lua
if [ -z ${target} ]; then
config_file=config/config.lua
fi
if [ ! -f ${config_file} ]; then
echo "config file ${config_file} not exist"
exit 1
fi
# pid文件
pid_path=./game.${target}.pid
if [ -z $target ]; then
pid_path=./game.pid
fi
if [ ! -f ${pid_path} ]; then
echo "no such file: ${pid_path}"
exit 1
fi
process_id=`cat ${pid_path}`
if [ -z $process_id ]; then
echo "kill error, no such process"
exit 1
fi
# 发送命令让数据库进行存储
ip=`sed -n -r 's/debug_ip *= *"([0-9\.]*)"/\1/p' $config_file`
port=`sed -n -r 's/debug_port *= *([0-9]+)/\1/p' $config_file`
if [ -z ${ip} ] || [ -z ${port} ]; then
echo "debug_ip or debug_port not found in config file: $config_file"
exit 1
fi
curl --http0.9 --noproxy "*" "http://${ip}:${port}/call/.GAME_LOGGER/\"flush\""
curl --http0.9 --noproxy "*" "http://${ip}:${port}/call/.MONGO_POOL/\"flush\""
kill $process_id
echo "kill success, target: ${target}, process_id: ${process_id}"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。