Error: no such theme PatternSkinTheme
-- MartinDluhos - 2011-09-21

Stop Firefox Script

This script stops an existing firefox instance, so that user can open a new instance:
# description: This script kills a running Iceweasel (Firefox) instance, so
#                   that a new one can be started.
# author:       Martin Dluhos
# created:     September 8, 2011
# revised:     September 21, 2011

# Change into Firefox's default profile directory
pushd ~/.mozilla/firefox/*.default

# The lock file is a symbolic link to an ip:+pid
# Find the ip and pid to which the lock is symlinking
ip=`/usr/bin/file lock | /bin/grep -o -E '([0-9]{1,3}\.){3}[0-9]{1,3}'`
pid=`/usr/bin/file lock | /bin/grep -o -E ':\+[0-9]+' | /usr/bin/cut -d '+' -f 2`

# ssh into the machine with the ip and kill the process with the pid
exit_status=`/usr/bin/ssh $ip "/bin/kill -15 $pid; echo $?" | tail -1`

# Print a helpful message to the user
if [ $exit_status -eq 0 ]
then
    /bin/echo "Iceweasel has been terminated successfuly."
    /bin/echo "You may now start a new instance!"
else
    /bin/echo "Iceweasel did NOT terminate!"
fi

# Restore the working directory at the end
popd
Topic revision: r6 - 2011-09-21, JeffLeep
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback