Skip to content

Commit

Permalink
myip: no need to hide the output, it runs quietly already
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavid committed Jan 21, 2024
1 parent d619222 commit 06a6b15
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/myip
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# shellcheck disable=SC1091,SC2034 # File not following, appears unused.
set -- "$@" --quiet
readonly \
BASE_APP_VERSION=0.9.20240102 \
BASE_APP_VERSION=0.9.20240121 \
BASE_MIN_VERSION=0.9.20240102
. base.sh

Expand Down Expand Up @@ -40,7 +40,7 @@ myip() {
loge OpenDNS failed: "$ip"
return 0
}
var_exists ip >/dev/null 2>&1 || {
var_exists ip || {
ip="$(
dig \
-4 \
Expand All @@ -54,7 +54,7 @@ myip() {
return 0
}
ip="$(printf %s "$ip" | awk -F\" '{print $2}')"
var_exists ip >/dev/null 2>&1 || {
var_exists ip || {
loge OpenDNS and Google DNS failed to resolve my IP
return 0
}
Expand All @@ -70,13 +70,13 @@ myip() {
awk -F':[ \t]+' 'tolower($1) ~ /^stateprov$/ {print toupper($2)}' |
head -1
)"
var_exists state >/dev/null 2>&1 || {
var_exists state || {
state="$(
printf %s "$out" |
awk -F':[ \t]+' 'tolower($1) ~ /^country$/ {print toupper($2)}' |
head -1
)"
var_exists state >/dev/null 2>&1 ||
var_exists state ||
state=NO
}
dur="$(chrono_get run)" || die
Expand Down

0 comments on commit 06a6b15

Please sign in to comment.