Skip to content

Instantly share code, notes, and snippets.

@jabedude
Created March 25, 2016 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jabedude/668ddb56f92d5bb893c3 to your computer and use it in GitHub Desktop.
Save jabedude/668ddb56f92d5bb893c3 to your computer and use it in GitHub Desktop.
solaris host up/down
#!/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