Created
March 11, 2019 10:20
-
-
Save erdnuesse/c905689e02235cbbd9caa8c4e833b71d to your computer and use it in GitHub Desktop.
check multiple connections and write to a log
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
#!/bin/bash | |
# make sure to install fping first. | |
# and run this in a screen env. or make sure it's detachable, I was lazy. | |
# | |
adddate() { | |
while IFS= read -r line; do | |
echo "$(date +%Y-%m-%d" "%H:%M:%S) $line" | |
done | |
} | |
while true; do fping <ip-1> <ip-2> <ip-n> | adddate | tee -a output.log;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment