diff --git a/web/whatismyip b/web/whatismyip index ec634ad..c4f3a6b 100755 --- a/web/whatismyip +++ b/web/whatismyip @@ -16,8 +16,12 @@ done IP=$( dig +short myip.opendns.com @resolver1.opendns.com ) if [[ "$NAME" -eq 1 ]]; then - dig +short -x "$IP" + output=$( dig +short -x "$IP" ) else - echo $IP + output="$IP" fi +if [[ -z "$output" ]]; then + exit 1 +fi +echo "$output"