Browse Source

fix(info): gather external ip from ipify.org instead of ifconfig.co (#2953)

pull/2956/head
Daniel Gibbs 5 years ago
committed by GitHub
parent
commit
8462086922
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lgsm/functions/info_distro.sh

6
lgsm/functions/info_distro.sh

@ -228,7 +228,7 @@ netlink=$(ethtool "${netint}" 2>/dev/null| grep Speed | awk '{print $2}')
# External IP address # External IP address
if [ -z "${extip}" ]; then 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=$? exitcode=$?
# Should ifconfig.co return an error will use last known IP. # Should ifconfig.co return an error will use last known IP.
if [ ${exitcode} -eq 0 ]; then if [ ${exitcode} -eq 0 ]; then
@ -238,14 +238,14 @@ if [ -z "${extip}" ]; then
if [ -f "${tmpdir}/extip.txt" ]; then if [ -f "${tmpdir}/extip.txt" ]; then
extip=$(cat "${tmpdir}/extip.txt") extip=$(cat "${tmpdir}/extip.txt")
else else
echo -e "x.x.x.x" fn_print_error_nl "Unable to get external IP"
fi fi
fi fi
else else
if [ -f "${tmpdir}/extip.txt" ]; then if [ -f "${tmpdir}/extip.txt" ]; then
extip=$(cat "${tmpdir}/extip.txt") extip=$(cat "${tmpdir}/extip.txt")
else else
echo -e "x.x.x.x" fn_print_error_nl "Unable to get external IP"
fi fi
fi fi
fi fi

Loading…
Cancel
Save