diff --git a/main.sh b/main.sh index b19403f..0eae86c 100644 --- a/main.sh +++ b/main.sh @@ -111,7 +111,8 @@ game_send_package() { restart_server "core" "$channel" fi else - awk '{print $2}' "txt/$channel" | tr -d '\r' | while read -r ip; do + for ip in $(awk '{print $2}' "txt/$channel") + do unzip_package $ip $package $source_tar $destination_dir if [[ $reboot -eq 1 ]]; then restart_server "core" "$ip" @@ -130,7 +131,8 @@ gm_send_package() { if is_valid_ip "$channel"; then unzip_package $channel $package $source_tar $destination_dir else - awk '{print $2}' "txt/$channel" | tr -d '\r' | while read -r ip; do + for ip in $(awk '{print $2}' "txt/$channel") + do unzip_package $ip $package $source_tar $destination_dir done fi @@ -269,7 +271,8 @@ gm_option() { restart_server "admin" "$ip" elif [ "$action" = "batch_reboot" ]; then local path="/data/update/script/txt/gm_ip.txt" - awk '{print $2}' "${path}" | tr -d '\r' | while read -r ip; do + for ip in $(awk '{print $2}' "${path}") + do echo -e "开始更新gm $ip" restart_server "admin" "$ip" done