[or-cvs] Make OSX install happier about running on non-default volume.

Nick Mathewson nickm at seul.org
Fri Mar 18 22:43:49 UTC 2005


Update of /home/or/cvsroot/tor/contrib/osx
In directory moria.mit.edu:/tmp/cvs-serv31500/contrib/osx

Modified Files:
	Tor TorPostflight TorStartupInfo.plist 
Log Message:
Make OSX install happier about running on non-default volume.

Index: Tor
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/Tor,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Tor	18 Mar 2005 21:58:52 -0000	1.3
+++ Tor	18 Mar 2005 22:43:46 -0000	1.4
@@ -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 @@
 # 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
 }

Index: TorPostflight
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/TorPostflight,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- TorPostflight	18 Mar 2005 21:45:36 -0000	1.4
+++ TorPostflight	18 Mar 2005 22:43:46 -0000	1.5
@@ -56,4 +56,10 @@
   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

Index: TorStartupInfo.plist
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/TorStartupInfo.plist,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- TorStartupInfo.plist	5 Jan 2005 02:46:25 -0000	1.2
+++ TorStartupInfo.plist	18 Mar 2005 22:43:46 -0000	1.3
@@ -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>



More information about the tor-commits mailing list