Skip to content

Instantly share code, notes, and snippets.

@aravindkumarsvg
Created July 20, 2017 15:00
Show Gist options
  • Save aravindkumarsvg/ebef46861f4c28732ac2240e95ec4c50 to your computer and use it in GitHub Desktop.
Save aravindkumarsvg/ebef46861f4c28732ac2240e95ec4c50 to your computer and use it in GitHub Desktop.
Checks for the Network connection
#!/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