From 62b2c7cf5d30813e0e5db02f424a6f1c52964786 Mon Sep 17 00:00:00 2001 From: nough Date: Mon, 2 Aug 2021 09:45:02 +0100 Subject: [PATCH] update get_ip with more comments, change if [] change if [ ! -z ] to if [ -n ] --- bbb-install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bbb-install.sh b/bbb-install.sh index c75caf1..6ebf6c7 100755 --- a/bbb-install.sh +++ b/bbb-install.sh @@ -441,7 +441,9 @@ wait_443() { } get_IP() { - if [ ! -z "$IP" ]; then return 0; fi + # This function determines the local IP, sets the variable $IP, then attempts to determine external IP and check if external IP reaches the internal IP. + # Determine if get_IP has already been called ($IP exists), if so, no need to run again. + if [ -n "$IP" ]; then return 0; fi # Determine local IP need_pkg net-tools @@ -471,7 +473,7 @@ get_IP() { fi # Check if the external IP reaches the internal IP - if [ ! -z "$external_ip" ] && [ "$IP" != "$external_ip" ]; then + if [ -n "$external_ip" ] && [ "$IP" != "$external_ip" ]; then if which nginx; then systemctl stop nginx fi