2006-07-27 01:52:59 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# TorPreFlight is invoked before the install begins
|
|
|
|
|
2006-07-27 02:19:36 +02:00
|
|
|
# Figure out where Tor is installed
|
|
|
|
if [ -f /Library/StartupItems/Tor/Tor.loc ]; then
|
|
|
|
TORPATH=`cat /Library/StartupItems/Tor/Tor.loc`
|
|
|
|
else
|
|
|
|
TORPATH="/Library/Tor/"
|
|
|
|
fi
|
2006-08-08 03:42:52 +02:00
|
|
|
|
|
|
|
if [ -f /Library/StartupItems/Privoxy/Privoxy.loc ]; then
|
|
|
|
PRIVOXYPATH=`cat /Library/StartupItems/Privoxy/Privoxy.loc`
|
|
|
|
else
|
2006-09-18 07:35:08 +02:00
|
|
|
PRIVOXYPATH="/Library/Privoxy/"
|
2006-08-08 03:42:52 +02:00
|
|
|
fi
|
2006-07-27 02:19:36 +02:00
|
|
|
|
|
|
|
# Backup all of Tor, just in case
|
|
|
|
if [ -d $TORPATH ]; then
|
2006-08-08 03:42:52 +02:00
|
|
|
tar zcf /tmp/TorSavedMe.tar.gz $TORPATH/var/lib/tor $TORPATH/torrc $PRIVOXYPATH/config $PRIVOXYPATH/user.action
|
2006-07-27 01:52:59 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Remove Tor and everything to do with it
|
2006-07-27 02:19:36 +02:00
|
|
|
if [ -f $TORPATH/uninstall_tor_bundle.sh ]; then
|
|
|
|
$TORPATH/uninstall_tor_bundle.sh
|
|
|
|
else
|
|
|
|
$PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh
|
2006-07-27 01:52:59 +02:00
|
|
|
fi
|
|
|
|
|
2006-07-27 02:19:36 +02:00
|
|
|
# This is complete, we have a fresh system on which to install Tor
|