#!/bin/bash
# killFirefox script by Paul Sherman <http://www.pcbypaul.com>
# does not just kill firefox-bin, but also removes lock file 
# from user home dir so that firefox can be restarted.
# uses the bash shell and xdialog
#
# c2007 by Paul Sherman <psherma1@rochester.rr.com> http://www.pcbypaul.com     #
#									        #
# This program is free software; you can redistribute it and/or			#
# modify it under the terms of the GNU General Public License			#
# as published by the Free Software Foundation; either version 2		#
# of the License, or (at your option) any later version.
#
DIALOG=Xdialog
$DIALOG	--title "Firefox Destroyer" \
      	--yesno "This script will close any running instances of the Firefox browser.\nDo you wish to continue?" 0 0
	sel=$?
	case $sel in
		0) echo "Firefox will be destroyed.";;
		1) echo "OK, never mind" ; 
		   exit ;;
		255) echo "OK, never mind" ;
		     exit ;;
	esac 
killall -9 firefox 2>/dev/null
find "$HOME/.mozilla/firefox" -name ".parentlock" -exec rm {} \;
$DIALOG --title "Success..." \
        --msgbox "If any instances of Firefox were open, \nthey are no more." 0 0
exit 0
