]> Pileus Git - ~andy/sunrise/blob - net-misc/mugshot/files/mugshot-1.1.40-firefox-update.sh
sunrise/net-misc/mugshot/files/mugshot-1.1.26-firefox-update.sh: Version bump. Now...
[~andy/sunrise] / net-misc / mugshot / files / mugshot-1.1.40-firefox-update.sh
1 #!/bin/sh
2
3 # This script is used to add and remove our extension from the Firefox
4 # directory, and is run from 'triggers' when Firefox is installed or
5 # upgraded, as well as when our package is installed. 
6 #
7
8 firedir=/usr/GET_LIBDIR/mozilla-firefox
9 firedirs="${firedir}"
10
11 if [ "$1" = "install" ] ; then
12     for d in ${firedirs} ; do
13         # Add symlink to the firefox directory that looks like it is part of a
14         # currently installed package
15         if [ -e "$d/firefox-bin" -a -d "$d/extensions" -a ! -L "$d/extensions/firefox@mugshot.org" ] ; then
16             ln -s /usr/GET_LIBDIR/mugshot/firefox "$d/extensions/firefox@mugshot.org"
17         fi
18     done
19 elif [ "$1" = "remove" ] ; then
20     for d in ${firedirs} ; do
21         # Remove the symlink we've created 
22         if [ -L "$d/extensions/firefox@mugshot.org" ] ; then
23             rm "$d/extensions/firefox@mugshot.org"
24         fi
25     done
26 else
27     echo "Usage firefox-update.sh [install/remove]"
28 fi