Explorar o código

added if to reduce externalip queries

if extip already exists then skip over the query. Should help reduce the chance of getting error 429 Too Many Requests
Daniel Gibbs %!s(int64=8) %!d(string=hai) anos
pai
achega
f1c0b8ea00
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lgsm/functions/info_distro.sh

+ 3 - 1
lgsm/functions/info_distro.sh

@@ -135,4 +135,6 @@ if [ -d "${backupdir}" ]; then
 fi
 
 # External IP address
-extip=$(curl -m 3 ifconfig.co 2>/dev/null)
+if [ -z "${extip}" ];then
+	extip=$(curl -m 3 ifconfig.co 2>/dev/null)
+fi