diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-03-18 22:43:46 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-03-18 22:43:46 +0000 |
commit | e1e7ffcae7eb03d9e9420049addad6dce1643f74 (patch) | |
tree | c0707ee637c3c4aad27496bed26a2b7cbfe3107f /contrib/osx | |
parent | 71c7733154a4ee004a49f0de4e378c3a52cf377f (diff) | |
download | tor-e1e7ffcae7eb03d9e9420049addad6dce1643f74.tar.gz tor-e1e7ffcae7eb03d9e9420049addad6dce1643f74.zip |
Make OSX install happier about running on non-default volume.
svn:r3777
Diffstat (limited to 'contrib/osx')
-rwxr-xr-x | contrib/osx/Tor | 18 | ||||
-rw-r--r-- | contrib/osx/TorPostflight | 8 | ||||
-rw-r--r-- | contrib/osx/TorStartupInfo.plist | 2 |
3 files changed, 22 insertions, 6 deletions
diff --git a/contrib/osx/Tor b/contrib/osx/Tor index ba2b1418d0..83bb2a6f5b 100755 --- a/contrib/osx/Tor +++ b/contrib/osx/Tor @@ -1,11 +1,21 @@ #!/bin/sh -TORCONF=/Library/Tor/torrc -TORDIR=/Library/Tor/var/lib/tor +TORLOC=/Library/StartupItems/Tor/Tor.loc + +if [ -f $TORLOC ]; then + TORDIR=`cat /Library/StartupItems/Tor/Tor.loc` + if [ "x$TORDIR" = "x" -o ! -d $TORDIR -o ! -x $TORDIR/tor ]; then + TORDIR=/Library/Tor + fi +else + TORDIR=/Library/Tor +fi +TORCONF=$TORDIR/torrc +TORDATA=$TORDIR/var/lib/tor TORPID=/var/run/Tor.pid TORUSER=_tor TORGROUP=daemon -TORCMD=/Library/Tor/tor +TORCMD=$TORDIR/tor TORLOG=/var/log/tor/tor.log ## @@ -25,7 +35,7 @@ StartService () # Tentative # Making sure it is not running (I know it is not a best approarch) killall tor 2>/dev/null - $TORCMD -f $TORCONF --runasdaemon 1 --pidfile $TORPID --datadirectory $TORDIR --user $TORUSER --group $TORGROUP --log "notice file $TORLOG" & + $TORCMD -f "$TORCONF" --runasdaemon 1 --pidfile "$TORPID" --datadirectory "$TORDATA" --user "$TORUSER" --group "$TORGROUP" --log "notice file $TORLOG" & fi fi } diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight index e3689589a2..284fcfc303 100644 --- a/contrib/osx/TorPostflight +++ b/contrib/osx/TorPostflight @@ -56,4 +56,10 @@ if [ ! -e /var/log/tor -o -L /var/log/tor ]; then cd /var/log rm -f tor ln -sf $LOGDIR tor -fi
\ No newline at end of file +fi + +if [ ! -d /Library/StartupItems/Tor ]; then + mkdir -p /Library/StartupItems/Tor +fi +rm -f /Library/StartupItems/Tor/Tor.loc +echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc diff --git a/contrib/osx/TorStartupInfo.plist b/contrib/osx/TorStartupInfo.plist index 7fd729a59a..593f6f975c 100644 --- a/contrib/osx/TorStartupInfo.plist +++ b/contrib/osx/TorStartupInfo.plist @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>CFBundleGetInfoString</key> - <string>Tor Startup Script (experimental)</string> + <string>Tor Startup Script</string> <key>CFBundleName</key> <string>Tor Startup Script</string> <key>CFBundleSortVersionString</key> |