mirror of
https://github.com/byReqz/conn.git
synced 2024-11-22 09:01:15 +00:00
tweaked windows detection, added url detection to ipv6
This commit is contained in:
parent
5fd6b0c05f
commit
f25e045e6f
15
conn.sh
Normal file → Executable file
15
conn.sh
Normal file → Executable file
@ -115,6 +115,10 @@ fi
|
|||||||
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"
|
||||||
|
if [[ "$2" =~ http ]];then
|
||||||
|
echo "url detected, exiting"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
echo "checking connection status for $2"
|
echo "checking connection status for $2"
|
||||||
fping=$(fping -6 -a $2)
|
fping=$(fping -6 -a $2)
|
||||||
p135=$(nping -6 -q1 -c1 -p135 $2)
|
p135=$(nping -6 -q1 -c1 -p135 $2)
|
||||||
@ -241,11 +245,16 @@ fi
|
|||||||
fping=$(fping -a $2)
|
fping=$(fping -a $2)
|
||||||
p135=$(nping -q1 -c1 -p135 $2)
|
p135=$(nping -q1 -c1 -p135 $2)
|
||||||
p3389=$(nping -q1 -c1 -p3389 $2)
|
p3389=$(nping -q1 -c1 -p3389 $2)
|
||||||
if [[ $fping = "$2" ]] && [[ -n $(echo $p135 | grep "Successful connections: 1") ]];then
|
if [[ $fping = "$2" ]] && [[ -n $(echo $p135 | grep "Successful connections: 0") ]];then
|
||||||
echo "-------------------Availability----------------------"
|
echo "-------------------Availability----------------------"
|
||||||
echo "note: this seems to be a unix machine which does respond to ICMP"
|
echo "note: this seems to be a unix machine which does respond to ICMP"
|
||||||
notify-send "$2 is a unix machine" -u normal -t 30000 -a conn
|
notify-send "$2 is a unix machine" -u normal -t 30000 -a conn
|
||||||
echo "-----------------------------------------------------"
|
echo "-----------------------------------------------------"
|
||||||
|
elif [[ $fping = "$2" ]] && [[ -n $(echo $p135 | grep "Successful connections: 1") ]];then
|
||||||
|
echo "-------------------Availability----------------------"
|
||||||
|
echo "note: this seems to be a windows machine which does respond to ICMP"
|
||||||
|
notify-send "$2 is a windows machine" -u normal -t 30000 -a conn
|
||||||
|
echo "-----------------------------------------------------"
|
||||||
else
|
else
|
||||||
while [[ -z $(nping -q1 -c1 -p135 $2 | grep "Successful connections: 1") ]]; do :
|
while [[ -z $(nping -q1 -c1 -p135 $2 | grep "Successful connections: 1") ]]; do :
|
||||||
done
|
done
|
||||||
@ -274,6 +283,10 @@ fi
|
|||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
elif [[ ! "$1" =~ [0-9]{1,3}(\.[0-9]{1,3}){3} ]] && [[ "$1" =~ [:] ]] && [[ ! "$2" =~ [:] ]] && [[ -z "$3" ]];then
|
elif [[ ! "$1" =~ [0-9]{1,3}(\.[0-9]{1,3}){3} ]] && [[ "$1" =~ [:] ]] && [[ ! "$2" =~ [:] ]] && [[ -z "$3" ]];then
|
||||||
|
if [[ "$1" =~ http ]];then
|
||||||
|
echo "url detected, exiting"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
echo "detected IPv6 adress -> using -6"
|
echo "detected IPv6 adress -> using -6"
|
||||||
echo "checking connection status for $1"
|
echo "checking connection status for $1"
|
||||||
fping=$(fping -6 -a $1)
|
fping=$(fping -6 -a $1)
|
||||||
|
Loading…
Reference in New Issue
Block a user