From 6e40823b9004cfad8b87d2c7b5253b66c6330e5c Mon Sep 17 00:00:00 2001 From: nils Date: Mon, 6 Dec 2021 17:20:32 +0100 Subject: [PATCH] quick fix for v6 adresses being rejected --- conn.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conn.sh b/conn.sh index e1832a2..060b109 100755 --- a/conn.sh +++ b/conn.sh @@ -86,7 +86,12 @@ function set_argvars { function validate { for arg in $@; do - if ip route show " $arg" 2&> /dev/null;then + if [[ ! "$arg" =~ : ]];then + arg=" $arg" # fixes issue with leading space on ipv6 adresses + else + only="-6" # enable ipv6, this needs a more complex function to avoid treating every argument as v6 + fi + if ip route show "$arg" 2&> /dev/null;then hosts="$hosts $arg" elif nslookup "$arg" > /dev/null;then hosts="$hosts $arg"