From 2708baee162f805a8d9518aab8da53a4936fe10b Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Wed, 28 Oct 2020 19:48:47 +0200 Subject: [PATCH] stick to IPV4 for now --- web/whatismyip | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/whatismyip b/web/whatismyip index 33ae705..26a86ad 100755 --- a/web/whatismyip +++ b/web/whatismyip @@ -14,7 +14,7 @@ function locals_only() { } function ifconfig_service() { which curl &>/dev/null && { - curl ifconfig.co/json; exit $? + curl -4 ifconfig.co/json; exit $? } which wget &>/dev/null && { wget -q -O - ifconfig.co/json; exit $? @@ -46,6 +46,9 @@ which dig &> /dev/null || { IP=$( dig +short myip.opendns.com @resolver1.opendns.com ) +if [[ -z "$IP" ]]; then + IP=$( curl -s -4 ifconfig.co/ip ) +fi if [[ "$NAME" -eq 1 ]]; then output=$( dig +short -x "$IP" )