From 236930bc73bad1aa6c176765e6c07f7058a5b124 Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 28 Nov 2021 19:19:39 +0100 Subject: [PATCH] fix issue with unrecognized arguments --- conn.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conn.sh b/conn.sh index 3601249..f62c16f 100755 --- a/conn.sh +++ b/conn.sh @@ -76,6 +76,10 @@ function get_args { # echo "the given argument \""$arg"\" is not known" # done # fi + + #quick fix to prevent nslookups interactive mode being triggered by wrong arguments + #some other places in the code have also gotten a leading space to prevent similar issues + input=$(echo "$input" | tr -d "-") } function set_argvars { @@ -104,7 +108,7 @@ function set_argvars { function validate { for arg in $@; do - if $(ip route show "$arg" 2&> /dev/null);then + if $(ip route show " $arg" 2&> /dev/null);then hosts="$hosts $arg" elif $(nslookup "$arg" > /dev/null);then hosts="$hosts $arg"