59 lines
1.7 KiB
Bash
59 lines
1.7 KiB
Bash
#! /bin/bash
|
|
|
|
SERVER_DIR=/data/server/dhmmc
|
|
|
|
ROOT=`cd $(dirname $0);pwd`
|
|
if [ -d ${ROOT} ]; then
|
|
cd ${ROOT}
|
|
fi
|
|
|
|
error() {
|
|
echo -e "[错误] $(date '+%Y-%m-%d %H:%M:%S') $@"
|
|
exit 1
|
|
}
|
|
|
|
# 打印信息
|
|
echo2() {
|
|
echo -e "[操作] $(date '+%Y-%m-%d %H:%M:%S') $@"
|
|
}
|
|
|
|
cmd() {
|
|
echo -e "[指令] $(date '+%Y-%m-%d %H:%M:%S') $@"
|
|
}
|
|
|
|
cmd "========= sh ${SERVER_DIR}/login_server_s900/bin/login_server eval \"login_server_app:clear_server_db($1).\" ========="
|
|
sh ${SERVER_DIR}/login_server_s900/bin/login_server eval "login_server_app:clear_server_db($1)."
|
|
if [ $? -ne 0 ]; then
|
|
error "关服删库失败,请检查"
|
|
exit 1
|
|
fi
|
|
|
|
cmd "========= sh ${SERVER_DIR}/login_server_s900/bin/login_server eval \"login_server_app:remove_server_data($1).\" ========="
|
|
sh ${SERVER_DIR}/login_server_s900/bin/login_server eval "login_server_app:remove_server_data($1)."
|
|
if [ $? -ne 0 ]; then
|
|
error "清理登录服数据失败,请检查"
|
|
exit 1
|
|
fi
|
|
|
|
case "$1" in
|
|
"901")
|
|
cmd "========= sh ${SERVER_DIR}/game_server_s901/bin/game_server daemon ========="
|
|
sh ${SERVER_DIR}/game_server_s901/bin/game_server daemon
|
|
;;
|
|
"902")
|
|
cmd "========= sh ${SERVER_DIR}/game_server_s902/bin/game_server daemon ========="
|
|
sh ${SERVER_DIR}/game_server_s902/bin/game_server daemon
|
|
;;
|
|
*)
|
|
echo2 "清档后请自行启动服务器"
|
|
;;
|
|
esac
|
|
|
|
#if [ $1 -eq 901 ]; then
|
|
# cmd "========= rm -rf ${SERVER_DIR}/game_server_s901/dets ========="
|
|
# rm -rf ${SERVER_DIR}/game_server_s901/dets
|
|
# cmd "========= sh ${SERVER_DIR}/game_server_s901/bin/game_server daemon ========="
|
|
# sh ${SERVER_DIR}/game_server_s901/bin/game_server daemon
|
|
#fi
|
|
|
|
echo2 "$1服 清档成功......" |