From 0219eb655c7d6382a339b8f8ea1ef33b3a9376b1 Mon Sep 17 00:00:00 2001 From: "PC-202302260912\\Administrator" <1769111741@qq.com> Date: Thu, 27 Jul 2023 14:15:48 +0800 Subject: [PATCH] =?UTF-8?q?gm=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function/function.sh | 7 ++++--- hotfix_game.sh | 4 ++-- update_gm.sh | 16 ++++++++-------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/function/function.sh b/function/function.sh index 1c1aaab..f292c7c 100644 --- a/function/function.sh +++ b/function/function.sh @@ -87,15 +87,16 @@ gm_reboot(){ mod_gm_package(){ ip=${1} + package=gm.tar.gz + # 源服务器上的tar压缩包路径 + source_tar="/data/update/project/miduo_gm/gm" # 游戏服目标服务器上的目标目录路径 destination_dir="/data/jieling/gm" - # 源服务器上的tar压缩包路径 - source_tar="/data/update/project/miduo_gm/gm/gm.tar.gz" if [ -e $source_tar ]; then echo "正在处理服务器 $ip" scp "$source_tar/$package" "$ip:$destination_dir" ssh "$ip" "tar -zxvf $destination_dir/$package -C $destination_dir" - ssh "$ip" "rm -rf $destination_dir/$package" + ssh "$ip" "rm -f $destination_dir/$package" echo "处理完成服务器 $ip " else echo "gm.tar.gz 不存在,请先去打包 " diff --git a/hotfix_game.sh b/hotfix_game.sh index 3514c54..aa1883c 100644 --- a/hotfix_game.sh +++ b/hotfix_game.sh @@ -89,7 +89,7 @@ rm -rf ${BASE_DIR}/hotfix/conf/*.json yes|cp -r ${BASE_DIR}/miduo_server/conf/c_database_version.json ${BASE_DIR}/hotfix/conf yes|cp -r ${BASE_DIR}/miduo_server/conf/hotfix.json ${BASE_DIR}/hotfix/conf -cd ${BASE_DIR} +cd ${BASE_DIR} || exit find hotfix/conf/ -type f -name "*.txt"|egrep -v "c_database_version|hotfix"|xargs rm -rf find hotfix/conf/ -type f -name "*.class" |xargs rm -rf @@ -102,7 +102,7 @@ cat ${BASE_DIR}/miduo_server/conf/c_database_version.json echo "cat miduo_server/conf/hotfix.json" cat ${BASE_DIR}/miduo_server/conf/hotfix.json -cd ${BASE_DIR}/hotfix +cd ${BASE_DIR}/hotfix || exit tar -czvf hotfix.tar.gz ./* mv hotfix.tar.gz /data/update/package/${packages} echo "打包${packages}完成" diff --git a/update_gm.sh b/update_gm.sh index 4e051ff..421b660 100644 --- a/update_gm.sh +++ b/update_gm.sh @@ -28,15 +28,15 @@ mvn clean package #删除旧文件 rm -rf ${BASE_DIR}/gm/* #创建新目录文件 -zip_dir=${BASE_DIR}/gm/config -mkdir -p ${zip_dir}/jsonconf -mkdir -p ${zip_dir}/script +json_dir=${BASE_DIR}/gm/config/jsonconf +mkdir -p ${json_dir} #复制文件 -cp -rf ${TABLE_DIR}/miduo_server/conf/server/ItemConfig.txt ${zip_dir}/jsonconf/ItemConfig.txt -cp -rf ${TABLE_DIR}/miduo_server/conf/server/RechargeCommodityConfig.txt ${zip_dir}/jsonconf/RechargeCommodityConfig.txt -cp -rf ${BASE_DIR}/conf/jsonconf/Reason.txt ${zip_dir}/jsonconf/Reason.txt -cp -rf ${BASE_DIR}/target/gm_tw_admin-1.0-SNAPSHOT.jar ${BASE_DIR}/gm/gm_tw_admin-1.0-SNAPSHOT.jar -cp -rf ${BASE_DIR}/conf/script ${BASE_DIR}/gm/config/script +cp -f ${TABLE_DIR}/miduo_server/conf/server/ItemConfig.txt ${json_dir}/ItemConfig.txt +cp -f ${TABLE_DIR}/miduo_server/conf/server/RechargeCommodityConfig.txt ${json_dir}/RechargeCommodityConfig.txt +cp -f ${BASE_DIR}/conf/jsonconf/Reason.txt ${json_dir}/Reason.txt +cp -f ${BASE_DIR}/target/gm_tw_admin-1.0-SNAPSHOT.jar ${BASE_DIR}/gm/gm_tw_admin-1.0-SNAPSHOT.jar +cp -rf ${BASE_DIR}/conf/script ${BASE_DIR}/gm/config +mv ${BASE_DIR}/gm/config/script/gm_reboot.sh ${BASE_DIR}/gm/gm_reboot.sh #打包 cd ${BASE_DIR}/gm || exit