Browse Source

changes to if

pull/3015/head
Daniel Gibbs 5 years ago
parent
commit
de4f6dc255
  1. 10
      lgsm/functions/check_ip.sh

10
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

Loading…
Cancel
Save