mirror of
https://github.com/byReqz/conn.git
synced 2024-11-24 09:44:56 +00:00
Compare commits
No commits in common. "faf77df3f6e342c6b04a46a0ca7cc5d206c46fb4" and "198d8beb9114502c94a4947cde2ececee2cf523a" have entirely different histories.
faf77df3f6
...
198d8beb91
13
conn.sh
13
conn.sh
@ -57,14 +57,7 @@ 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
|
||||||
for v in $input; do
|
input=$(echo "$input" | tr -d "-")
|
||||||
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 {
|
||||||
@ -93,7 +86,9 @@ function set_argvars {
|
|||||||
|
|
||||||
function validate {
|
function validate {
|
||||||
for arg in $@; do
|
for arg in $@; do
|
||||||
if [[ "$arg" =~ : ]];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
|
only="-6" # enable ipv6, this needs a more complex function to avoid treating every argument as v6
|
||||||
fi
|
fi
|
||||||
if ip route show "$arg" 2&> /dev/null;then
|
if ip route show "$arg" 2&> /dev/null;then
|
||||||
|
Loading…
Reference in New Issue
Block a user