diff options
author | Andrew Lewman <andrew@torproject.org> | 2007-10-15 04:04:16 +0000 |
---|---|---|
committer | Andrew Lewman <andrew@torproject.org> | 2007-10-15 04:04:16 +0000 |
commit | d0eda6dbb0ec7f48d7ca0b825872b64c856cc720 (patch) | |
tree | 79442188491515c9e6e898b1d9f7583779fb22fb /contrib/osx/TorPostflight | |
parent | 3dfb943d1f881ee95720fd602965de6e19c595ea (diff) | |
download | tor-d0eda6dbb0ec7f48d7ca0b825872b64c856cc720.tar tor-d0eda6dbb0ec7f48d7ca0b825872b64c856cc720.tar.gz |
Introducing Torbutton integration to the Tor-Privoxy OSX bundle.
svn:r11938
Diffstat (limited to 'contrib/osx/TorPostflight')
-rw-r--r-- | contrib/osx/TorPostflight | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight index a0f86cf82..2bd6f29ec 100644 --- a/contrib/osx/TorPostflight +++ b/contrib/osx/TorPostflight @@ -13,6 +13,7 @@ TORGROUP=daemon TARGET=$2/Library/Tor TORDIR=$TARGET/var/lib/tor LOGFILE=/var/log/tor.log +TORBUTTON_VERSION="1.1.8-alpha" # Check defaults for TARGET if [ "$TARGET" == "//Library/Tor" ]; then @@ -40,7 +41,7 @@ fi # Create the configuration file only if there wasn't one already. if [ ! -f $TARGET/torrc ]; then - cp $TARGET/torrc.sample $TARGET/torrc.sample + cp $TARGET/torrc.sample $TARGET/torrc fi # Ensure symbolic links @@ -70,12 +71,12 @@ fi # Copy Uninstaller if [ -f $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript ]; then cp $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript $TARGET/Tor_Uninstaller.applescript - chmod 555 $TARGET/Tor_Uninstaller.applescript + chmod 550 $TARGET/Tor_Uninstaller.applescript fi if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh ]; then cp $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh $TARGET/uninstall_tor_bundle.sh - chmod 555 $TARGET/uninstall_tor_bundle.sh + chmod 550 $TARGET/uninstall_tor_bundle.sh fi if [ -f $PACKAGE_PATH/Contents/Resources/package_list.txt ]; then @@ -86,3 +87,19 @@ if [ -d /Library/StartupItems/Tor ]; then rm -f /Library/StartupItems/Tor/Tor.loc echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc fi + +if [ -f /Applications/Firefox.app/Contents/MacOS/firefox ]; then + if [ -f $TARGET/torbutton-$TORBUTTON_VERSION.xpi ]; then + /Applications/Firefox.app/Contents/MacOS/firefox -install-global-extension $TARGET/torbutton-$TORBUTTON_VERSION.xpi +# The following is a kludge to get around the fact that the installer +# runs as root. This means the Torbutton extension will install with +# root permissions; thereby making uninstalling Torbutton from inside +# Firefox impossible. The user will be caught in an endless loop of +# uninstall -> automatic re-installation of Torbutton. The OSX +# installer doesn't tell you the owner of Firefox, therefore we have to +# parse it. + USR=`ls -alrt /Applications/Firefox.app/Contents/MacOS/extensions/ | tail -1 | awk '{print $3}'` + GRP=`ls -alrt /Applications/Firefox.app/Contents/MacOS/extensions/ | tail -1 | awk '{print $4}'` + chown -R $USR:$GRP /Applications/Firefox.app/Contents/MacOS/extensions/ + fi +fi |