#!/bin/bashtouch .macwatch while [ -e .macwatch ] ; do sleep 10 NOW=`date '+%s'` echo $NOW for i in 251 252 253 ; do ~/findmac.pl -c public sg250-$i | egrep '08:5b:0e:43:29:7c|00:0c:29:eb:14:c8' > $NOW.ssg250-$i diff $NOW.ssg250-$i ref.ssg250-$i if [ $? == 0 ]; then rm $NOW.ssg250-$i fi done done