From f4af5c05fc8e9c7f3ca90ee2d46ea55495641f2a Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Thu, 12 Nov 2020 05:53:38 +0000 Subject: [PATCH] [node.sh] return ipv4 address only Signed-off-by: Leo Chen --- scripts/node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/node.sh b/scripts/node.sh index 1aa05d042..2b5dafe8c 100755 --- a/scripts/node.sh +++ b/scripts/node.sh @@ -56,7 +56,7 @@ function valid_ip() function myip() { # get ipv4 address only, right now only support ipv4 addresses - PUB_IP=$(dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}') + PUB_IP=$(dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}') if valid_ip $PUB_IP; then msg "public IP address autodetected: $PUB_IP" else