Merge pull request #1552 from rico-chet/detect-http-errors-in-myip
plugins/base: Detect HTTP errors in `myip()`pull/1545/head
commit
7945415334
|
|
@ -32,7 +32,7 @@ function myip ()
|
||||||
list=("http://myip.dnsomatic.com/" "http://checkip.dyndns.com/" "http://checkip.dyndns.org/")
|
list=("http://myip.dnsomatic.com/" "http://checkip.dyndns.com/" "http://checkip.dyndns.org/")
|
||||||
for url in ${list[*]}
|
for url in ${list[*]}
|
||||||
do
|
do
|
||||||
res=$(curl -s "${url}")
|
res=$(curl -fs "${url}")
|
||||||
if [ $? -eq 0 ];then
|
if [ $? -eq 0 ];then
|
||||||
break;
|
break;
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue