1 Star 1 Fork 0

Seven/sf-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
stop.sh 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
Seven 提交于 2025-01-07 17:34 . 使用.lua作为配置文件的后缀
#!/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}"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/806203871/sf-server.git
[email protected]:806203871/sf-server.git
806203871
sf-server
sf-server
master

搜索帮助