|
@@ -2,7 +2,7 @@
|
|
|
# LGSM fn_check_ip function
|
|
# LGSM fn_check_ip function
|
|
|
# Author: Daniel Gibbs
|
|
# Author: Daniel Gibbs
|
|
|
# Website: http://danielgibbs.co.uk
|
|
# Website: http://danielgibbs.co.uk
|
|
|
-# Version: 210115
|
|
|
|
|
|
|
+# Version: 260115
|
|
|
|
|
|
|
|
# Description: Automatically identifies the server interface IP.
|
|
# Description: Automatically identifies the server interface IP.
|
|
|
# If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0".
|
|
# If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0".
|
|
@@ -12,8 +12,8 @@ if [ ! -f /bin/ip ]; then
|
|
|
else
|
|
else
|
|
|
ipcommand="ip"
|
|
ipcommand="ip"
|
|
|
fi
|
|
fi
|
|
|
-getip=$(${ipcommand} -o -4 addr|awk '{print $4 }'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
|
|
|
|
|
-getipwc=$(${ipcommand} -o -4 addr|awk '{print $4 }'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0)
|
|
|
|
|
|
|
+getip=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
|
|
|
|
|
+getipwc=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0)
|
|
|
|
|
|
|
|
if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
|
|
if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
|
|
|
if [ "${getipwc}" -ge "2" ]; then
|
|
if [ "${getipwc}" -ge "2" ]; then
|