projects
/
webi-installers
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup: shfmt, shellcheck, and whitespace
[webi-installers/.git]
/
myip
/
myip.sh
diff --git
a/myip/myip.sh
b/myip/myip.sh
index 1fb90eeacd11888687a6cbf18fe93def420c25d7..ca57d6c493ba5ceab3a72dc07741c27393817b9a 100644
(file)
--- a/
myip/myip.sh
+++ b/
myip/myip.sh
@@
-7,16
+7,16
@@
function __show_my_ip {
ipv4=$(curl -s https://api.ipify.org || true)
ipv6=$(curl -s https://api6.ipify.org || true)
ipv4=$(curl -s https://api.ipify.org || true)
ipv6=$(curl -s https://api6.ipify.org || true)
- if [[ -n
"${ipv4}"
]]; then
+ if [[ -n
${ipv4}
]]; then
echo "IPv4 (A) : $ipv4"
fi
echo "IPv4 (A) : $ipv4"
fi
- if [[ -n
"$ipv6"
]] && [[ "ipv6" != "ipv4" ]]; then
+ if [[ -n
$ipv6
]] && [[ "ipv6" != "ipv4" ]]; then
echo "IPv6 (AAAA): $ipv6"
fi
echo "IPv6 (AAAA): $ipv6"
fi
- if [[ -z
"$ipv4"
]] && [[ -z "ipv6" ]]; then
-
>&2 echo
"error: no public IP address"
+ if [[ -z
$ipv4
]] && [[ -z "ipv6" ]]; then
+
echo >&2
"error: no public IP address"
fi
}
fi
}