From 3e6463f7b07b9b1854542f594d500296f70c8fc4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Sep 2017 20:36:56 +0100 Subject: [PATCH] Now gets internet IP for servers that are behind NAT --- lgsm/functions/info_distro.sh | 3 +++ lgsm/functions/info_messages.sh | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 0c2c770a3..b2f75b78b 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -133,3 +133,6 @@ if [ -d "${backupdir}" ]; then lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}') fi fi + +# External IP address +extip=$(curl -m 3 ifconfig.co 2>/dev/null) \ No newline at end of file diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 1a8bb28c6..3c8dd9e1c 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -134,6 +134,13 @@ fn_info_message_gameserver(){ # Server ip echo -e "${blue}Server IP:\t${default}${ip}:${port}" + # External server ip + if [ -n "${extip}" ]; then + if [ "${ip}" != "${extip}"]; then + echo -e "${blue}Internet IP:\t${default}${extip}:${port}" + fi + fi + # Server password if [ -n "${serverpassword}" ]; then echo -e "${blue}Server password:\t${default}${serverpassword}"