Created
June 1, 2014 20:53
-
-
Save DomiR/2fe49a84bd807cb162d4 to your computer and use it in GitHub Desktop.
Beep when online again.
This file contains hidden or 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
beepwhenup () { | |
echo 'Enter host you want to ping:'; read PHOST; | |
if [[ "$PHOST" == "" ]]; | |
then exit; fi; | |
while true; | |
do ping -c1 -W2 $PHOST 2>&1 >/dev/null; | |
if [[ "$?" == "0" ]]; | |
then for j in $(seq 1 4); | |
do beep; | |
done; | |
ping -c1 $PHOST; | |
break; | |
fi; | |
done; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment