TorPreFlight 827 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. # TorPreFlight is invoked before the install begins
  3. # Figure out where Tor is installed
  4. if [ -f /Library/StartupItems/Tor/Tor.loc ]; then
  5. TORPATH=`cat /Library/StartupItems/Tor/Tor.loc`
  6. else
  7. TORPATH="/Library/Tor/"
  8. fi
  9. if [ -f /Library/StartupItems/Privoxy/Privoxy.loc ]; then
  10. PRIVOXYPATH=`cat /Library/StartupItems/Privoxy/Privoxy.loc`
  11. else
  12. PRIVOXYPATH="/Library/Prioxy/"
  13. fi
  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 $PRIVOXYPATH/config $PRIVOXYPATH/user.action
  17. fi
  18. # Remove Tor and everything to do with it
  19. if [ -f $TORPATH/uninstall_tor_bundle.sh ]; then
  20. $TORPATH/uninstall_tor_bundle.sh
  21. else
  22. $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh
  23. fi
  24. # This is complete, we have a fresh system on which to install Tor