bugfix: add missing variable $ prefix
authorAJ ONeal <aj@therootcompany.com>
Mon, 26 Apr 2021 07:05:00 +0000 (07:05 +0000)
committerAJ ONeal <aj@therootcompany.com>
Mon, 26 Apr 2021 07:05:00 +0000 (07:05 +0000)
myip/myip.sh

index ca57d6c493ba5ceab3a72dc07741c27393817b9a..cc60be770e618fddc6e7cd4cfb40d12b43c92e0f 100644 (file)
@@ -11,11 +11,11 @@ function __show_my_ip {
         echo "IPv4 (A)   : $ipv4"
     fi
 
-    if [[ -n $ipv6 ]] && [[ "ipv6" != "ipv4" ]]; then
-        echo "IPv6 (AAAA): $ipv6"
+    if [[ -n ${ipv6} ]] && [[ ${ipv6} != "${ipv4}" ]]; then
+        echo "IPv6 (AAAA): ${ipv6}"
     fi
 
-    if [[ -z $ipv4 ]] && [[ -z "ipv6" ]]; then
+    if [[ -z ${ipv4} ]] && [[ -z ${ipv6} ]]; then
         echo >&2 "error: no public IP address"
     fi
 }