Comment 137 for bug 93546

Revision history for this message
In , Dav1dblunk3tt (dav1dblunk3tt) wrote :

This script resolves most of the problems associated with this stupid bug for me, while it doesn't fix the bug it does make using firefox on several machines sharing the same filestore possible without feeling like you have to throw the computer out of the window:

#!/bin/sh
HN=`hostname`

echo hostname set to $HN
if test -e ~/.mozilla/firefox/lock_host ; then
        LM=`cat ~/.mozilla/firefox/lock_host`
        echo Firefox has taken a lock out on the following machine:
        cat ~/.mozilla/firefox/lock_host
        if test $LM = $HN ; then
                echo Running a repeat firefox
                /usr/bin/firefox
                exit 0
        else
                if kdialog --yesno "Firefox is locked on machine $LM \n Do you want me to kill it?" ; then
                        echo OK I got a YES
                        ssh -o "StrictHostKeyChecking no" $LM "killall -regexp firefox"
                        kdialog --msgbox "Now try again"
                else
                        echo Ok I got a NO
                        exit 0
                        fi
                exit 0
                fi
        fi

echo No lock_host detected
echo Making lock_host
hostname > ~/.mozilla/firefox/lock_host
echo Running firefox
/usr/bin/firefox
echo Removing lock_host
rm ~/.mozilla/firefox/lock_host

It is a little sloppy and could be neater and could handle ssh requiring a password but it works for me.