How can I check whether my internet connection is active on Ubuntu. If I am connected to a wired or wi-fi network, the indicator applet shows that I'm connected. But there is now way to find out the internet is working or not. I have some problem in my internet connectivity and I frequently lose my connection. I found this link is useful
Is an Internet connectivity indicator applet available for the Unity panel?
But I don't know that where should I use this code!
#!/bin/bash
if ping -c 1 -W 2 google.com > /dev/null; then
echo "Up"
else
echo "Down"
fi
Best Answer
The link you indicated is self explanatory. Even so, the necessary parts for implementing the script are:
Open up a console and type:
mkdir -p ~/scripts && cd ~/scripts
After that type the following
gedit pingtest.sh
Paste this code:
Save the file
Again on the console
Then you have the file created, all you need is to follow the other steps indicated on the link you posted