Created
July 20, 2017 15:00
-
-
Save aravindkumarsvg/ebef46861f4c28732ac2240e95ec4c50 to your computer and use it in GitHub Desktop.
Checks for the Network connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################################## | |
# | |
# Checks for Network connection by using Ping utility | |
# | |
######################################################## | |
# Main flow of Execution | |
main() { | |
while : | |
do | |
ping -c3 google.com | |
if [ $? -ne 0 ] | |
then | |
: | |
else | |
echo -e "\nConnection Established!!!!!!!!!!!!!!!!!!!!\n" | |
break | |
fi | |
done | |
} | |
# Starts the main flow | |
main | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment