Skip to content

Instantly share code, notes, and snippets.

@e0da
Last active December 19, 2015 03:18
Show Gist options
  • Save e0da/5888793 to your computer and use it in GitHub Desktop.
Save e0da/5888793 to your computer and use it in GitHub Desktop.
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