diff --git a/wholive b/wholive index 3798b4e..8b1bdad 100755 --- a/wholive +++ b/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