Skip to content

Instantly share code, notes, and snippets.

@tbaschak
Created September 5, 2019 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbaschak/2131edd195e8d1a98c2bc8e9fb10cf62 to your computer and use it in GitHub Desktop.
Save tbaschak/2131edd195e8d1a98c2bc8e9fb10cf62 to your computer and use it in GitHub Desktop.
waits for a host to come up, then sends a notification
#!/bin/bash
IP="1.1.1.1"
while [ "$RETURNCODE" != "0" ]; do
ping -c 1 $IP &> /dev/null
RETURNCODE=$? # ; echo $?
sleep 1
done
echo "Host $IP is up" | slackcat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment