Created
March 25, 2016 14:20
-
-
Save jabedude/668ddb56f92d5bb893c3 to your computer and use it in GitHub Desktop.
solaris host up/down
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 | |
[ $# -lt 1 ] && echo too few args && exit 1 | |
while test "$1"; do | |
if [[ `ping "$1" 2` == "$1 is alive" ]] | |
then | |
echo $1 is alive | |
else | |
echo $1 is down | |
fi | |
shift | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment