From 34eee2028a46202cd3b047c340409e4bf776055d Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Thu, 28 Dec 2023 03:58:18 +0100 Subject: [PATCH] fix the "there's no valid IP at all for this configuration" bug where the whole route where echoed --- scripts/_common.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index c93d0ae..2f17b73 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -60,6 +60,7 @@ process_ips(){ # used to process the IPs to put in the AGH's config file local ips="$1" + local processed_ips for i in $(seq "$(echo "$ips" | wc -w)" -1 1); do ip=$(echo "$ips" | awk "{print \$$i}") @@ -69,13 +70,13 @@ process_ips(){ if is_public_ip "$ip" && [ "$open_port_53" == "false" ] ; then break else - ips="$ip" + processed_ips="$ip" break fi fi done - echo "$ips" + echo "$processed_ips" } update_agh_config(){