wholive - test_arp(), for fast

This commit is contained in:
Slava Rogozhkin 2025-08-19 11:03:17 +03:00
parent 96554fe0ba
commit 5a33a595af
1 changed files with 21 additions and 7 deletions

18
wholive
View File

@ -21,10 +21,24 @@ table_print() {
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
table_print $stand $suc "$(date +%X)"
else
table_print $stand $fail "$(date +%X)"
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