|
|
@@ -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")
|