#literal #! /bin/sh
set -e
RUNNING=`ps -ax | grep "fennec.*/fennec" | grep -v grep | wc -l`
if [ $RUNNING -gt 0 ];
then
dbus-send --system --type=method_call --dest=mozilla.fennec /mozilla/fennec/request mozilla.fennec.quit
x=0
while [ $x -lt 10 ]
do
sleep 1
if [ $RUNNING -eq 0 ];
break
fi
x=`expr $x + 1`
done
pkill -9 fennec