1
0
mirror of https://github.com/byReqz/conn.git synced 2025-07-04 19:30:48 +00:00

Compare commits

..

5 Commits

Author SHA1 Message Date
faf77df3f6 updated hash after commit 2022-04-02 23:42:28 +00:00
4f62ddc933 fixup last commit 2022-04-03 01:41:56 +02:00
198d8beb91 updated hash after commit 2021-12-06 16:21:39 +00:00
f4b83b6896 remove hash 2021-12-06 17:21:14 +01:00
6e40823b90 quick fix for v6 adresses being rejected 2021-12-06 17:20:32 +01:00
2 changed files with 13 additions and 3 deletions

14
conn.sh
View File

@ -57,7 +57,14 @@ function get_args {
#quick fix to prevent nslookups interactive mode being triggered by invalid arguments #quick fix to prevent nslookups interactive mode being triggered by invalid arguments
#some other places in the code have also gotten a leading space to prevent similar issues #some other places in the code have also gotten a leading space to prevent similar issues
input=$(echo "$input" | tr -d "-") for v in $input; do
if [[ ! $(echo $v | cut -c1) == "-" ]];then
newinput="$newinput $v"
else
newinput="$newinput $(echo $v | cut -c 2-)"
fi
done
input="$newinput"
} }
function set_argvars { function set_argvars {
@ -86,7 +93,10 @@ function set_argvars {
function validate { function validate {
for arg in $@; do for arg in $@; do
if ip route show " $arg" 2&> /dev/null;then if [[ "$arg" =~ : ]];then
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" hosts="$hosts $arg"
elif nslookup "$arg" > /dev/null;then elif nslookup "$arg" > /dev/null;then
hosts="$hosts $arg" hosts="$hosts $arg"

2
hash
View File

@ -1 +1 @@
0f91143820ae11bd353a4ff25dc8cca5 03ef6d9fd9c11b849ada616caf66bf22