## read last cutycapt pid#thisfile=/tmp/.cutycaptchecka=0if [ -f "$thisfile" ]; then a=`head $thisfile | cut -b1-5`fi## record Capt into .cutycapcheck again#top -b -n 1 | grep Cuty > $thisfile## read current pid#b=`head $thisfile | cut -b1-5`#echo "a == $a"#echo "b == $b"if [ x"$a" = "x" ]; then logger "CutyCaptCheck: Do nothing (No A)" exitfiif [ x"$b" = "x" ]; then logger "CutyCaptCheck: Do nothing (No B)" exitfiif [ "$a" -eq "$b" ]; then logger "CutyCaptCheck: KILL pid = $a" kill -9 $aelse logger "CutyCaptCheck: Do nothing (A != B)"fi
*/3 * * * * root /usr/sbin/killcuty