Skip to content

Instantly share code, notes, and snippets.

@raulmoyareyes
Last active October 5, 2015 21:04
Show Gist options
  • Save raulmoyareyes/bca65f749aa415ca7bfd to your computer and use it in GitHub Desktop.
Save raulmoyareyes/bca65f749aa415ca7bfd to your computer and use it in GitHub Desktop.
Check your internet connection.
#!/bin/bash
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
echo "Online"
else
echo "Offline"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment