diff --git a/shikong_main.sh b/shikong_main.sh index f78308f..d23651b 100644 --- a/shikong_main.sh +++ b/shikong_main.sh @@ -5,6 +5,7 @@ stty erase ^h # 文字颜色 red='\033[31m' +# shellcheck disable=SC2034 green='\033[32m' yellow='\033[33m' blue='\033[34m' @@ -91,7 +92,9 @@ server_build_update(){ send_server_package $channel $package $source_tar $destination_dir case $reboot in [yY][eE][sS]|[yY]) - echo "暂未开放重启功能..." + ssh "$ip" "bash $destination_dir/bin/stop.sh core1" + sleep 5 + ssh "$ip" "bash $destination_dir/bin/start.sh core1" ;; *) echo "更新结束..." @@ -103,7 +106,9 @@ server_build_update(){ send_server_package $ip $package $source_tar $destination_dir case $reboot in [yY][eE][sS]|[yY]) - echo "暂未开放重启功能..." + ssh "$ip" "bash $destination_dir/bin/stop.sh core1" + sleep 5 + ssh "$ip" "bash $destination_dir/bin/start.sh core1" ;; *) echo "更新结束..." @@ -113,8 +118,64 @@ server_build_update(){ fi ;; "world") + if if_ip "$channel"; then + send_server_package $channel $package $source_tar $destination_dir + case $reboot in + [yY][eE][sS]|[yY]) + ssh "$ip" "bash $destination_dir/bin/stop.sh world" + sleep 5 + ssh "$ip" "bash $destination_dir/bin/start.sh world" + ;; + *) + echo "更新结束..." + ;; + esac + else + for ip in $(awk '{print $2}' "txt/$channel") + do + send_server_package $ip $package $source_tar $destination_dir + case $reboot in + [yY][eE][sS]|[yY]) + ssh "$ip" "bash $destination_dir/bin/stop.sh world" + sleep 5 + ssh "$ip" "bash $destination_dir/bin/start.sh world" + ;; + *) + echo "更新结束..." + ;; + esac + done + fi ;; "chat") + if if_ip "$channel"; then + send_server_package $channel $package $source_tar $destination_dir + case $reboot in + [yY][eE][sS]|[yY]) + ssh "$ip" "bash $destination_dir/bin/stop.sh chat" + sleep 5 + ssh "$ip" "bash $destination_dir/bin/start.sh chat" + ;; + *) + echo "更新结束..." + ;; + esac + else + for ip in $(awk '{print $2}' "txt/$channel") + do + send_server_package $ip $package $source_tar $destination_dir + case $reboot in + [yY][eE][sS]|[yY]) + ssh "$ip" "bash $destination_dir/bin/stop.sh chat" + sleep 5 + ssh "$ip" "bash $destination_dir/bin/start.sh chat" + ;; + *) + echo "更新结束..." + ;; + esac + done + fi ;; esac } diff --git a/update_sk_pay.sh b/update_sk_pay.sh index a73e3fc..ba5d357 100644 --- a/update_sk_pay.sh +++ b/update_sk_pay.sh @@ -16,6 +16,6 @@ cd /data/update/project/sk_pay || exit git pull mvn clean package if [ ! -z ${ip} ];then - scp ${BASE_DIR}/target/delivery-server-1.0-SNAPSHOT.jar ${ip}:/data/shikong/delivery-server/ + scp ${BASE_DIR}/target/idip-1.0-SNAPSHOT.jar ${ip}:/data/shikong/idip/ scp ${BASE_DIR}/pay_reboot.sh ${ip}:/data/shikong/delivery-server/pay_reboot.sh fi diff --git a/update_sk_server.sh b/update_sk_server.sh index 62b2e3d..ed5998a 100644 --- a/update_sk_server.sh +++ b/update_sk_server.sh @@ -10,7 +10,7 @@ branch=$1 package=$2 -packages=${package}_logic.tar.gz +packages=${package}_server.tar.gz if [ ! $branch ];then echo "branch is not exiting," exit 7