Last active
December 19, 2015 03:18
-
-
Save e0da/5888793 to your computer and use it in GitHub Desktop.
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
notify_sshable() { | |
host=$1 | |
timeout=${2:-1} | |
sound=${3:-"$HOME/Dropbox/sounds/LOZ_Secret.wav"} | |
iteration=0 | |
while true; do | |
let iteration=$iteration+1 | |
echo "Attempt $iteration..." | |
ssh -oConnectTimeout=$timeout $host true | |
if [ $? = 0 ]; then | |
aplay $sound | |
break | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment