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:
parent
c9de29f3ec
commit
236930bc73
6
conn.sh
6
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"
|
||||
|
Loading…
Reference in New Issue
Block a user