Skip to content
Permalink
Browse files

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

  • Loading branch information
dgibbs64 committed Mar 10, 2020
1 parent 4ba7fc0 commit 0af1f5ed4756b75d977e6b0cee071569db69d67a
Showing with 9 additions and 1 deletion.
  1. +9 −1 lgsm/functions/info_distro.sh
@@ -232,7 +232,15 @@ if [ -z "${extip}" ]; then
exitcode=$?
# Should ifconfig.co return an error will use last known IP.
if [ ${exitcode} -eq 0 ]; then
echo -e "${extip}" > "${tmpdir}/extip.txt"
if [[ "${extip}" != *"DOCTYPE"* ]]; then
echo -e "${extip}" > "${tmpdir}/extip.txt"
else
if [ -f "${tmpdir}/extip.txt" ]; then
extip=$(cat "${tmpdir}/extip.txt")
else
echo -e "x.x.x.x"
fi
fi
else
if [ -f "${tmpdir}/extip.txt" ]; then
extip=$(cat "${tmpdir}/extip.txt")

0 comments on commit 0af1f5e

Please sign in to comment.
You can’t perform that action at this time.