Created
May 16, 2018 15:48
-
-
Save sdomi/f00927bfe768891867e213ea28fde888 to your computer and use it in GitHub Desktop.
magic internet checker in bash
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 | |
# has interweb come back up? know today with this one simple trick! | |
ip=$1; | |
if ! [[ $ip ]]; then | |
ip="8.8.8.8"; | |
fi | |
while true; do | |
if ping -c 1 $ip &> /dev/null; then | |
notify-send --urgency=critical --icon=firefox "Internet is back up!" | |
break | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment