Merge pull request #1552 from rico-chet/detect-http-errors-in-myip
plugins/base: Detect HTTP errors in `myip()`
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user