From adaa619a37af499dac4f556d62e38bf54a74c29d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 6 Sep 2020 21:39:58 +0100 Subject: [PATCH] configip --- lgsm/functions/check_ip.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index 58efe62d1..4ea56a9fa 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -19,14 +19,14 @@ 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 has been set by user. +if [ -n "${ip}" ]; then + queryips=( "${ip}" ) # If game server IP is set IP address in game config. -if [ -n "${configip}" ]; then +elif [ -n "${configip}" ]; then queryips=( "${configip}" ) + ip="${configip}" # If IP has not been set by user. -elif [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]&&[ -z "${ip}" ]; then - queryips=( $(echo "${getip}") ) -# If the IP variable has been set by user. else - queryips=( "${ip}" ) + queryips=( $(echo "${getip}") ) fi