[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit a373383064afe14adfbe7cbc56253bc217c3d0fd
Author: Robert Ransom <rransom.8774@xxxxxxxxx>
Date:   Wed Aug 24 00:47:15 2011 -0400

    [Linux] Use complain to report all currently detected errors
    (cherry picked from commit 69bea9b7c46b23662fb0ae456997e482a0ad1222)
---
 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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits