From de4f6dc255452b2540f3f84c26f1605980d8c0e0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 5 Sep 2020 17:28:04 +0100 Subject: [PATCH] changes to if --- lgsm/functions/check_ip.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index d5532ce2a..fab74ae1c 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -19,11 +19,11 @@ getip=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\ getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|sort -u|grep -vc 127.0.0) # Check if server has m ultiple IP addresses -# If the ip variable is set by user -if [ "${ip}" != "0.0.0.0" ]&&[ "${ip}" != "" ]; then - queryips=( "${ip}" ) + # If ip is not set by user +if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]&&[ -z "${ip}" ]; then + queryips=( $(echo "${getip}") ) +# If the ip variable is set by user else - queryips=() - echo "${getip}" | IFS=" " read -r -a queryips + queryips=( "${ip}" ) fi