wholive - test_arp(), for fast
This commit is contained in:
parent
96554fe0ba
commit
5a33a595af
28
wholive
28
wholive
|
|
@ -21,10 +21,24 @@ table_print() {
|
|||
printf '%10s %-6s%-9s\n' $1 $2 $3
|
||||
}
|
||||
|
||||
for stand in ${stands[@]}; do
|
||||
if ping -W 1 -c 1 $stand &> /dev/null; then
|
||||
table_print $stand $suc "$(date +%X)"
|
||||
else
|
||||
table_print $stand $fail "$(date +%X)"
|
||||
fi
|
||||
done
|
||||
test_ping() {
|
||||
for stand in ${stands[@]}; do
|
||||
if ping -W 1 -c 1 $stand &> /dev/null; then
|
||||
table_print $stand $suc "$(date +%X)"
|
||||
else
|
||||
table_print $stand $fail "$(date +%X)"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
test_arp() {
|
||||
for stand in ${stands[@]}; do
|
||||
if /usr/sbin/arp $stand | grep -cq incomplete; then
|
||||
table_print $stand $fail "$(date +%X)"
|
||||
else
|
||||
table_print $stand $suc "$(date +%X)"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
test_arp
|
||||
|
|
|
|||
Loading…
Reference in New Issue