#!/bin/dash # Author: # Juhapekka Tolvanen # http://iki.fi/juhtolv # juhtolv (at) iki (dot) fi # This script is public domain. There is no warranty. KILLER="killall" #KILLER="pkill" BINARIES="firefox-esr firefox firefox.real firefox-bin xulrunner-stub /usr/lib/iceweasel/plugin-container plugin-container" #BINARIES="firefox-esr firefox-bin /usr/lib/xulrunner-27.0/plugin-container xulrunner-stub firefox netscape netscape-remote navigator communicator navigator-smotif.real navigator-dmotif.real navigator-smotif navigator-dmotif communicator-smotif.real communicator-dmotif.real communicator-smotif communicator-dmotif netscape-navigator netscape-communicator"" ########################################################### ## No luser-serviceable settings below this line (I hope). ########################################################### STARTTIME="`date +%s`" H=0 M=0 T=0 for signal in -TERM -INT -HUP -KILL do echo '*'" Signal: $signal " sleep 1 for binary in $BINARIES do sleep 1 echo '*'" $KILLER $signal $binary" if $KILLER $signal $binary then echo '***'" SIGNAL $signal HIT PROCESS $binary "'***' H=$(( $H + 1 )) sleep 1 else echo "Signal $signal missed process $binary" M=$(( $M + 1 )) sleep 1 fi T=$(( $T + 1 )) sleep 1 done sleep 1 echo '=======================================================================' done echo "Hits / Misses / Total: $H / $M / $T" ENDTIME="`date +%s`" REALFULLTIME="$(( $ENDTIME - $STARTTIME ))" echo "Total amount of time used: $REALFULLTIME seconds." # vim: set ft=sh :