diff --git a/main.sh b/main.sh index 89ecfd6..c9161d8 100644 --- a/main.sh +++ b/main.sh @@ -44,7 +44,9 @@ show_file(){ # 获取当前时间,精确到秒,格式年月日时分秒 get_current_time() { - date +"%Y%m%d%H%M%S" + local current_time + current_time=$(date +"%Y%m%d%H%M%S") + echo "$current_time" } # 发包并解压缩 @@ -184,7 +186,6 @@ exit_script() { update_game(){ while true; do echo -e "开始更新${green}游戏服${NC}" - echo -e "================================" echo -e "1. ${yellow}更新包${NC}" echo -e "2. ${yellow}正式服更新${NC}" echo -e "3. ${yellow}测试服更新${NC}" @@ -260,7 +261,6 @@ game_code_test(){ # gm更新 update_gm(){ while true; do - echo -e "================================" echo -e "开始更新${green}gm服${NC}" echo -e "1. ${yellow}打包${NC}" echo -e "2. ${yellow}单机器更新${NC}" @@ -284,7 +284,6 @@ gm_option() { case $action in "package") show_file project | grep "master" - echo -e "${blue}==============================${NC}" read -rp "请输入表所在游戏项目地址: " project bash "update_gm.sh" "$project" echo -e "gm打包完成" @@ -331,7 +330,6 @@ gm_send_package() { update_login(){ while true; do echo -e "开始更新${green}登陆服${NC}" - echo -e "================================" echo -e "1. ${yellow}更新登陆服代码${NC}" echo -e "2. ${yellow}重启登陆服${NC}" echo -e "0. ${green}返回主菜单${NC}" @@ -350,7 +348,6 @@ update_login(){ update_pay(){ while true; do echo -e "开始更新${green}支付服${NC}" - echo -e "================================" echo -e "1. ${yellow}更新支付服代码${NC}" echo -e "2. ${yellow}重启支付服${NC}" echo -e "0. ${green}返回主菜单${NC}" @@ -369,7 +366,6 @@ update_pay(){ update_mingan(){ while true; do echo -e "开始更新${green}敏感词服${NC}" - echo -e "================================" echo -e "1. ${yellow}更新敏感词服代码${NC}" echo -e "2. ${yellow}重启敏感词服${NC}" echo -e "0. ${green}返回主菜单${NC}" @@ -387,14 +383,15 @@ update_mingan(){ # 处理用户输入 handle_menu() { local current_time=get_current_time - echo -e "欢迎使用${blue}戒灵更新脚本-${current_time}${NC}" - echo -e "================================" + echo -e "****************************" + echo -e "${blue}欢迎使用戒灵更新脚本-${current_time}${NC}" echo -e "1. ${yellow}游戏服更新${NC}" echo -e "2. ${yellow}gm后台更新${NC}" echo -e "3. ${yellow}登陆服更新${NC}" echo -e "4. ${yellow}支付服更新${NC}" - echo -e "5. ${yellow}敏感词服更新${NC}" + echo -e "5. ${yellow}敏感词更新${NC}" echo -e "0. ${red}退出${NC}" + echo -e "****************************" read -rp "请输入选项编号: " choice case $choice in 1) update_game ;;