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

added IPv6 autodiscovery

also fixed some things and added more options
This commit is contained in:
Nils 2021-01-16 00:56:53 +00:00 committed by GitHub
parent c3aa98583b
commit 3592edfd00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

30
conn.sh
View File

@ -1,10 +1,14 @@
#!/bin/bash #!/bin/bash
while [ ! -n "$1" ]; do while [ ! -n "$1" ]; do
echo "Usage: $0 (-m) <ip> (y/n)" echo "Usage: $0 (-m) <ip>"
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
done done
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
@ -35,7 +39,29 @@ while [ ! -z "$1" ]; do
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"
fping $2 fping $2
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
exit exit
elif [[ $1 == "-6" ]] || [[ "$1" == "--force-ipv6" ]];then
echo "-6 used, forcing IPv6 portscanning"
echo "checking connection status for $2"
echo "-------------------Availability----------------------"
fping $2
echo "-----------------------------------------------------"
echo "-------------------Portscan---------------------"
nmap -Pn -6 $2
fping -c 4 -A $2
echo "------------------------------------------------"
exit
elif [[ ! "$1" =~ [0-9]{1,3}(\.[0-9]{1,3}){3} ]];then
echo "noticed IPv6 adress -> using -6"
echo "checking connection status for $1"
echo "-------------------Availability----------------------"
fping $1
echo "-----------------------------------------------------"
echo "-------------------Portscan---------------------"
nmap -Pn -6 $1
fping -c 4 -A $1
echo "------------------------------------------------"
exit
else else
echo "checking connection status for $1" echo "checking connection status for $1"
echo "-------------------Availability----------------------" echo "-------------------Availability----------------------"