Add aliveness script
This commit is contained in:
parent
0dab8e618e
commit
95af6da1b2
1 changed files with 14 additions and 0 deletions
14
acatcher/alive.sh
Executable file
14
acatcher/alive.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
if [ -z "$1" ]; then
|
||||
HOSTS="`grep -v ^# MASTER_LIST | cut -d\| -f3`"
|
||||
else
|
||||
HOSTS="`cat \"$1\"`"
|
||||
fi
|
||||
for HOST in $HOSTS; do
|
||||
ping -c 3 -q $HOST 2>&1 >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "[ UP ] $HOST"
|
||||
else
|
||||
echo "[DOWN] $HOST"
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue