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

14
wholive
View File

@ -21,6 +21,7 @@ table_print() {
printf '%10s %-6s%-9s\n' $1 $2 $3 printf '%10s %-6s%-9s\n' $1 $2 $3
} }
test_ping() {
for stand in ${stands[@]}; do 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)"
@ -28,3 +29,16 @@ for stand in ${stands[@]}; do
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