[tor-commits] [torbrowser/maint-2.2] [Linux] Use complain to report all currently detected errors

erinn at torproject.org erinn at torproject.org
Sun Oct 23 23:18:56 UTC 2011


commit 69bea9b7c46b23662fb0ae456997e482a0ad1222
Author: Robert Ransom <rransom.8774 at gmail.com>
Date:   Wed Aug 24 00:47:15 2011 -0400

    [Linux] Use complain to report all currently detected errors
---
 src/RelativeLink/RelativeLink.sh |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/RelativeLink/RelativeLink.sh b/src/RelativeLink/RelativeLink.sh
index 0435054..5be1bdc 100755
--- a/src/RelativeLink/RelativeLink.sh
+++ b/src/RelativeLink/RelativeLink.sh
@@ -59,7 +59,7 @@ complain () {
 }
 
 if [ "`id -u`" -eq 0 ]; then
-	echo "The Tor Browser Bundle should not be run as root.  Exiting."
+	complain "The Tor Browser Bundle should not be run as root.  Exiting."
 	exit 1
 fi
 
@@ -107,16 +107,18 @@ export DYLD_PRINT_LIBRARIES
 # if any relevant processes are running, inform the user and exit cleanly
 RUNNING=0
 for process in tor vidalia
+        # FIXME pidof isn't POSIX
         do pid="`pidof $process`"
         if [ -n "$pid" ]; then
 		printf "\n$process is already running as PID $pid\n\n"
 		RUNNING=1
+		break
 	fi
 	done
 
-if [ $RUNNING -eq 1 ]; then
-	printf "Please shut down the above process(es) before running Tor Browser Bundle.\n\n"
-	exit 0
+if [ "$RUNNING" -eq 1 ]; then
+	complain "$process is already running as PID $pid."$'\n\n'"Please shut down the above process(es) before running Tor Browser Bundle."
+	exit 1
 fi
 
 
@@ -148,4 +150,8 @@ fi
 printf "\nLaunching Tor Browser Bundle for Linux in ${HOME}\n"
 cd "${HOME}"
 ./App/vidalia --datadir Data/Vidalia/
-printf "\nExited cleanly. Goodbye.\n"
+exitcode="$?"
+if [ "$exitcode" -ne 0 ]; then
+	complain "Vidalia exited abnormally.  Exit code: $exitcode"
+	exit "$exitcode"
+fi





More information about the tor-commits mailing list