mirror of
https://github.com/Screetsec/TheFatRat.git
synced 2023-12-14 02:02:58 +01:00
Internet detection
A Different approach to check internet
This commit is contained in:
parent
995c8a907d
commit
c9300e9619
43
fatrat
43
fatrat
|
@ -1435,25 +1435,36 @@ echo -e $okegreen [✔]::[Terminal]: local ;
|
|||
fi
|
||||
|
||||
sleep 0.5
|
||||
#Checking internet connection by pinging hostname (google)
|
||||
#case ping hostname fails then run chknet function
|
||||
ping -c 1 google.com > /dev/null 2>&1
|
||||
png="$?"
|
||||
if [ $png == "0" ]
|
||||
then
|
||||
echo -e $okegreen [✔]::[Internet Connection]: CONNECTED!;
|
||||
sleep 0.5
|
||||
cont
|
||||
elif [ $png == "1" ]
|
||||
then
|
||||
echo -e $yellow [✔]::[Internet Connection]: LOCAL ONLY!;
|
||||
chknet
|
||||
elif [ $png == "2" ]
|
||||
then
|
||||
echo -e $red [✔]::[Internet Connection]: OFFLINE!;
|
||||
#Checking internet connection by connecting to google over http
|
||||
#case fails then run chknet function (ping)
|
||||
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e $red [ X ]::[Internet Connection]: OFFLINE!;
|
||||
chknet
|
||||
sleep 1
|
||||
else
|
||||
echo -e $green [ ✔ ]::[Internet Connection]: CONNECTED!;
|
||||
sleep 1
|
||||
cont
|
||||
fi
|
||||
|
||||
#ping -c 1 google.com > /dev/null 2>&1
|
||||
#png="$?"
|
||||
# if [ $png == "0" ]
|
||||
#then
|
||||
# echo -e $okegreen [✔]::[Internet Connection]: CONNECTED!;
|
||||
# sleep 0.5
|
||||
# cont
|
||||
#elif [ $png == "1" ]
|
||||
#then
|
||||
# echo -e $yellow [✔]::[Internet Connection]: LOCAL ONLY!;
|
||||
# chknet
|
||||
#elif [ $png == "2" ]
|
||||
#then
|
||||
#echo -e $red [✔]::[Internet Connection]: OFFLINE!;
|
||||
#chknet
|
||||
#fi
|
||||
|
||||
function Stop() {
|
||||
#Stoped Service postgresql & apache
|
||||
if [ "$distro" = "Kali" ]; then
|
||||
|
|
Loading…
Reference in a new issue