aboutsummaryrefslogtreecommitdiff
path: root/contrib/osx/TorPostflight
diff options
context:
space:
mode:
authorAndrew Lewman <andrew@torproject.org>2006-07-28 13:52:36 +0000
committerAndrew Lewman <andrew@torproject.org>2006-07-28 13:52:36 +0000
commit498fe874343acfef4ec2255e308aff27b0c6b65d (patch)
treea7c3f1da14e244d5a130fe92316e066067b2e9c9 /contrib/osx/TorPostflight
parente469438d20a374c174362cfac1c2fbb9cf84430c (diff)
downloadtor-498fe874343acfef4ec2255e308aff27b0c6b65d.tar
tor-498fe874343acfef4ec2255e308aff27b0c6b65d.tar.gz
So long, farewell, auf Wiedersehen, adieu, launchd
svn:r6932
Diffstat (limited to 'contrib/osx/TorPostflight')
-rw-r--r--contrib/osx/TorPostflight55
1 files changed, 7 insertions, 48 deletions
diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight
index 25a838bd0..8c8c32aa4 100644
--- a/contrib/osx/TorPostflight
+++ b/contrib/osx/TorPostflight
@@ -19,25 +19,6 @@ if [ "$TARGET" == "//Library/Tor" ]; then
TARGET=/Library/Tor
fi
-## Determine OSX Version
-# map version to name
-if [ -x /usr/bin/sw_vers ]; then
-# This is poor, yet functional. We don't care about the 3rd number in
-# the OS version
- OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
- case "$OSVER" in
- "10.5") OS="leopard";;
- "10.4") OS="tiger";;
- "10.3") OS="panther";;
- "10.2") OS="jaguar";;
- "10.1") OS="puma";;
- "10.0") OS="cheetah";;
- *) OS="unknown";;
- esac
-else
- OS="unknown"
-fi
-
# Create user $TORUSER in group daemon. If it's already there, great.
$ADDSYSUSER $TORUSER "Tor System user" $TORDIR
@@ -117,33 +98,11 @@ fi
# If the pre-install script did it's thing, it should have saved the
# config and server keys; put these back and clean up
if [ -f /tmp/TorSavedMe.tar.gz ]; then
- tar zxf /tmp/TorSavedMe.tar.gz -C /
- rm /tmp/TorSavedMe.tar.gz
-fi
-
-# Determine how to start by OS Version
-if [ $OS = "tiger" ]; then
- if [ -f $PACKAGE_PATH/Contents/Resources/net.freehaven.tor.plist ]; then
- rm -rf /Library/StartupItems/Tor
- cp $PACKAGE_PATH/Contents/Resources/net.freehaven.tor.plist /System/Library/LaunchDaemons/net.freehaven.tor.plist
- chmod 644 /System/Library/LaunchDaemons/net.freehaven.tor.plist
- if [ -f $TARGET/torrc ]; then
- IFS=,
- CONFIGVARS="#--START,RunAsDaemon 0,Log notice file $TARGET/var/log/tor/tor.log,DataDirectory $TARGET/var/lib/tor,Group daemon,User _tor,PidFile /var/run/Tor.pid,#--END"
- for var in ${CONFIGVARS}
- do
- RC=`grep ^$var $TARGET/torrc`
- if [ -z $RC ]; then
- echo "$var" >> $TARGET/torrc
- fi
- done
- fi
- fi
- /bin/launchctl load /System/Library/LaunchDaemons/net.freehaven.tor.plist
- /bin/launchctl start net.freehaven.tor
-else
- if [ -d /Library/StartupItems/Tor ]; then
- rm -f /Library/StartupItems/Tor/Tor.loc
- echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
- fi
+ tar zxf /tmp/TorSavedMe.tar.gz -C /
+ rm /tmp/TorSavedMe.tar.gz
+fi
+
+if [ -d /Library/StartupItems/Tor ]; then
+ rm -f /Library/StartupItems/Tor/Tor.loc
+ echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
fi