Commit 5b9466cf authored by Andrew Titmuss's avatar Andrew Titmuss

made publicip function faster by using dig

parent 438a3a29
...@@ -1659,7 +1659,10 @@ getlocalip () { ...@@ -1659,7 +1659,10 @@ getlocalip () {
} }
getpublicip () { getpublicip () {
if type -p curl >/dev/null 2>&1; then if type -p dig >/dev/null 2>&1; then
publicip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
elif type -p curl >/dev/null 2>&1; then
publicip="$(curl -w '\n' "$public_ip_host")" publicip="$(curl -w '\n' "$public_ip_host")"
elif type -p wget >/dev/null 2>&1; then elif type -p wget >/dev/null 2>&1; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment