Created
February 21, 2019 17:57
-
-
Save Memphizzz/df5762499a3ae713976ec7e1ec25265c to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
ping_cancelled=false | |
until ping -c1 "$1" &>/dev/null; do :; done & | |
trap "kill $!; ping_cancelled=true" SIGINT | |
wait $! | |
trap - SIGINT | |
echo "Done pinging, cancelled=$ping_cancelled" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment