2 # TorPreFlight is invoked before the install begins
4 # Figure out where Tor is installed
5 if [ -f /Library
/StartupItems
/Tor
/Tor.loc
]; then
6 TORPATH
=`cat /Library/StartupItems/Tor/Tor.loc`
7 elif [ -f /System
/Library
/LaunchDaemons
/net.freehaven.tor.plist
]; then
8 TORPATH
=/`grep -A1 "<key>Program</key>" /System/Library/LaunchDaemons/net.freehaven.tor.plist | grep string | cut -d"/" -f2,3`
10 TORPATH
="/Library/Tor/"
14 # Backup all of Tor, just in case
15 if [ -d $TORPATH ]; then
16 tar zcf
/tmp
/TorSavedMe.
tar.gz
$TORPATH/var
/lib
/tor
$TORPATH/torrc
19 # Remove Tor and everything to do with it
20 if [ -f $TORPATH/uninstall_tor_bundle.sh
]; then
21 $TORPATH/uninstall_tor_bundle.sh
23 $PACKAGE_PATH/Contents
/Resources
/uninstall_tor_bundle.sh
26 # This is complete, we have a fresh system on which to install Tor