1
0
mirror of https://github.com/byReqz/conn.git synced 2024-11-01 01:03:14 +00:00

tweaked ipv6 stuff and other args

This commit is contained in:
Nils 2021-01-16 01:38:25 +00:00 committed by GitHub
parent 3592edfd00
commit 3f84fecc14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

20
conn.sh
View File

@ -17,17 +17,21 @@ while [ ! -z "$1" ]; do
echo "Options:" echo "Options:"
echo " -m/--multi -- test multiple ips / disable portscan" echo " -m/--multi -- test multiple ips / disable portscan"
echo " -h/--help -- show help" echo " -h/--help -- show help"
echo " -6/--force-ipv6 -- force ipv6 portscanning (also forces portscanning)"
echo " -y/--yes -- portscan without asking"
echo " -n/--no -- dont portscan"
echo " -p/--portscan -- same as -y"
exit exit
elif [[ $1 == "-m" ]] || [[ "$1" == "--multi" ]];then elif [[ $1 == "-m" ]] || [[ "$1" == "--multi" ]];then
echo "multi-ip mode, portscan disabled" echo "multi-ip mode, portscan disabled"
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"
fping $@ fping -e $@
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
exit exit
elif [[ $1 == "-y" ]] || [[ $1 == "-p" ]] || [[ "$1" == "--portscan" ]] || [[ "$1" == "--yes" ]];then elif [[ $1 == "-y" ]] || [[ $1 == "-p" ]] || [[ "$1" == "--portscan" ]] || [[ "$1" == "--yes" ]];then
echo "checking connection status for $2" echo "checking connection status for $2"
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"
fping $2 fping -e $2
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
echo "-------------------Portscan---------------------" echo "-------------------Portscan---------------------"
nmap -Pn $2 nmap -Pn $2
@ -37,35 +41,35 @@ while [ ! -z "$1" ]; do
elif [[ $1 == "-n" ]] || [[ "$1" == "--no" ]];then elif [[ $1 == "-n" ]] || [[ "$1" == "--no" ]];then
echo "checking connection status for $2" echo "checking connection status for $2"
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"
fping $2 fping -e $2
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
exit exit
elif [[ $1 == "-6" ]] || [[ "$1" == "--force-ipv6" ]];then elif [[ $1 == "-6" ]] || [[ "$1" == "--force-ipv6" ]];then
echo "-6 used, forcing IPv6 portscanning" echo "-6 used, forcing IPv6 portscanning"
echo "checking connection status for $2" echo "checking connection status for $2"
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"
fping $2 fping -6 -e $2
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
echo "-------------------Portscan---------------------" echo "-------------------Portscan---------------------"
nmap -Pn -6 $2 nmap -Pn -6 $2
fping -c 4 -A $2 fping -6 -c 4 -A $2
echo "------------------------------------------------" echo "------------------------------------------------"
exit exit
elif [[ ! "$1" =~ [0-9]{1,3}(\.[0-9]{1,3}){3} ]];then elif [[ ! "$1" =~ [0-9]{1,3}(\.[0-9]{1,3}){3} ]];then
echo "noticed IPv6 adress -> using -6" echo "noticed IPv6 adress -> using -6"
echo "checking connection status for $1" echo "checking connection status for $1"
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"
fping $1 fping -6 -e $1
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
echo "-------------------Portscan---------------------" echo "-------------------Portscan---------------------"
nmap -Pn -6 $1 nmap -Pn -6 $1
fping -c 4 -A $1 fping -6 -c 4 -A $1
echo "------------------------------------------------" echo "------------------------------------------------"
exit exit
else else
echo "checking connection status for $1" echo "checking connection status for $1"
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"
fping $1 fping -e $1
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
echo "portscan? (y/n) (default: y)" echo "portscan? (y/n) (default: y)"
read portscan read portscan