TorPreFlight 636 B

123456789101112131415161718192021222324
  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. echo $TORPATH
  10. # Backup all of Tor, just in case
  11. if [ -d $TORPATH ]; then
  12. tar zcf /tmp/TorSavedMe.tar.gz $TORPATH/var/lib/tor $TORPATH/torrc
  13. fi
  14. # Remove Tor and everything to do with it
  15. if [ -f $TORPATH/uninstall_tor_bundle.sh ]; then
  16. $TORPATH/uninstall_tor_bundle.sh
  17. else
  18. $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh
  19. fi
  20. # This is complete, we have a fresh system on which to install Tor