1
0
mirror of https://github.com/byReqz/conn.git synced 2024-11-24 17:54:55 +00:00

fix issue with unrecognized arguments

This commit is contained in:
Nils 2021-11-28 19:19:39 +01:00
parent c9de29f3ec
commit 236930bc73
Signed by: byreqz
GPG Key ID: 396A62D7D436749E

View File

@ -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"