Created
September 5, 2019 16:37
-
-
Save tbaschak/2131edd195e8d1a98c2bc8e9fb10cf62 to your computer and use it in GitHub Desktop.
waits for a host to come up, then sends a notification
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 | |
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