Browse Source

fix(details): catch error should ifconfig.co fail (#2704)

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

8
lgsm/functions/info_distro.sh

@ -232,6 +232,7 @@ if [ -z "${extip}" ]; then
exitcode=$?
# Should ifconfig.co return an error will use last known IP.
if [ ${exitcode} -eq 0 ]; then
if [[ "${extip}" != *"DOCTYPE"* ]]; then
echo -e "${extip}" > "${tmpdir}/extip.txt"
else
if [ -f "${tmpdir}/extip.txt" ]; then
@ -240,6 +241,13 @@ if [ -z "${extip}" ]; then
echo -e "x.x.x.x"
fi
fi
else
if [ -f "${tmpdir}/extip.txt" ]; then
extip=$(cat "${tmpdir}/extip.txt")
else
echo -e "x.x.x.x"
fi
fi
fi
# Alert IP address

Loading…
Cancel
Save