wholive - test_arp(), for fast
This commit is contained in:
parent
96554fe0ba
commit
5a33a595af
18
wholive
18
wholive
|
|
@ -21,10 +21,24 @@ table_print() {
|
||||||
printf '%10s %-6s%-9s\n' $1 $2 $3
|
printf '%10s %-6s%-9s\n' $1 $2 $3
|
||||||
}
|
}
|
||||||
|
|
||||||
for stand in ${stands[@]}; do
|
test_ping() {
|
||||||
|
for stand in ${stands[@]}; do
|
||||||
if ping -W 1 -c 1 $stand &> /dev/null; then
|
if ping -W 1 -c 1 $stand &> /dev/null; then
|
||||||
table_print $stand $suc "$(date +%X)"
|
table_print $stand $suc "$(date +%X)"
|
||||||
else
|
else
|
||||||
table_print $stand $fail "$(date +%X)"
|
table_print $stand $fail "$(date +%X)"
|
||||||
fi
|
fi
|
||||||
done
|
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