From 8462086922d570f8f19997330b366b2cfbe78291 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 8 Jul 2020 21:42:16 +0100 Subject: [PATCH] fix(info): gather external ip from ipify.org instead of ifconfig.co (#2953) --- lgsm/functions/info_distro.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 1e2a519f4..c50953cdc 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -228,7 +228,7 @@ netlink=$(ethtool "${netint}" 2>/dev/null| grep Speed | awk '{print $2}') # External IP address if [ -z "${extip}" ]; then - extip=$(curl -4 -m 3 ifconfig.co 2>/dev/null) + extip=$(curl -s https://api.ipify.org 2>/dev/null) exitcode=$? # Should ifconfig.co return an error will use last known IP. if [ ${exitcode} -eq 0 ]; then @@ -238,14 +238,14 @@ if [ -z "${extip}" ]; then if [ -f "${tmpdir}/extip.txt" ]; then extip=$(cat "${tmpdir}/extip.txt") else - echo -e "x.x.x.x" + fn_print_error_nl "Unable to get external IP" fi fi else if [ -f "${tmpdir}/extip.txt" ]; then extip=$(cat "${tmpdir}/extip.txt") else - echo -e "x.x.x.x" + fn_print_error_nl "Unable to get external IP" fi fi fi