批量处理

main
PC-202302260912\Administrator 2023-08-07 19:14:02 +08:00
parent 3c9869649d
commit aa8d1846c1
1 changed files with 6 additions and 3 deletions

View File

@ -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