Last active
October 23, 2024 20:21
-
-
Save henri/b830bf51156302e51b975b3072f0d9c3 to your computer and use it in GitHub Desktop.
ping from stdin
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
#!/usr/bin/env bash | |
# | |
# This super basic script boiler plate | |
# will ping each host passed into the | |
# via stdin. Pipe your hosts into this | |
# script to check if they are up. | |
# | |
# Modify as needed for your purposes | |
# | |
# (C)2024 Henri Shustak - Released Under the GNU GPL 3.0 or later. | |
# | |
# version 1.0 - initial release - single ping only | |
# | |
while IFS= read -r line; do | |
# echo $line | |
ping -c 1 -W 0.5 "${line}" # | grep "packet" # | head -n 1 | |
# echo $? | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment