diff options
author | Andrew Lewman <andrew@torproject.org> | 2006-07-16 13:58:10 +0000 |
---|---|---|
committer | Andrew Lewman <andrew@torproject.org> | 2006-07-16 13:58:10 +0000 |
commit | 1478636f549d0791da78ef1cdd93cc5a44c3e8c2 (patch) | |
tree | 95a9aefc712341db476195e8efc381d82ed83b62 /contrib/osx/TorPostflight | |
parent | 886b10bbe2aa61fb325dec6aaae13f4804d86e2b (diff) | |
download | tor-1478636f549d0791da78ef1cdd93cc5a44c3e8c2.tar.gz tor-1478636f549d0791da78ef1cdd93cc5a44c3e8c2.zip |
Change the way Tor starts on OSX 10.4 vs pre-10.4. 10.4 Tor now uses
launchd for current and forward compatibility.
svn:r6766
Diffstat (limited to 'contrib/osx/TorPostflight')
-rw-r--r-- | contrib/osx/TorPostflight | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight index cf40cdda46..5713fd82b5 100644 --- a/contrib/osx/TorPostflight +++ b/contrib/osx/TorPostflight @@ -19,6 +19,25 @@ 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 @@ -88,6 +107,7 @@ if [ -f $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.app.tar.gz ]; then cd $TARGET && tar zxf Tor_Uninstaller.app.tar.gz chmod -R 755 $TARGET/Tor_Uninstaller.app chown -R _tor:_tor Tor_Uninstaller.app + rm $TARGET/Tor_Uninstaller.app.tar.gz fi if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh ]; then @@ -98,3 +118,14 @@ fi if [ -f $PACKAGE_PATH/Contents/Resources/package_list.txt ]; then cp $PACKAGE_PATH/Contents/Resources/package_list.txt $TARGET/package_list.txt fi + +if [ $OS = "tiger" ]; then + if [ -f $PACKAGE_PATH/Contents/Resources/net.freehaven.tor.plist ]; then + cp $PACKAGE_PATH/Contents/Resources/net.freehaven.tor.plist /System/Library/LaunchDaemons/net.freehaven.tor.plist + fi +else + if [ -d /Library/StartupItems/Tor ]; then + rm -f /Library/StartupItems/Tor/Tor.loc + echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc + fi +fi |