summaryrefslogtreecommitdiff
path: root/contrib/torctl.in
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-06-05 14:44:27 +0000
committerNick Mathewson <nickm@torproject.org>2005-06-05 14:44:27 +0000
commita94d7256ea9b4d944a6588bd5d67a1c046553a8b (patch)
tree79b19f45520a48a99915c84eec10af66ba9d7c5f /contrib/torctl.in
parent9f24078452d53b859d15e032b3aa88f244da8ecd (diff)
downloadtor-a94d7256ea9b4d944a6588bd5d67a1c046553a8b.tar.gz
tor-a94d7256ea9b4d944a6588bd5d67a1c046553a8b.zip
[bug 144] Have torctl.in/tor.sh.in check for location of su binary.
svn:r4311
Diffstat (limited to 'contrib/torctl.in')
-rw-r--r--contrib/torctl.in14
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/torctl.in b/contrib/torctl.in
index ee865844ba..4faa8f0a0b 100644
--- a/contrib/torctl.in
+++ b/contrib/torctl.in
@@ -54,11 +54,23 @@ if [ "x$TORGROUP" != "x" ]; then
TORARGS="$TORARGS --group $TORGROUP"
fi
+if [ -x /bin/su ] ; then
+ SUPROG=/bin/su
+elif [ -x /sbin/su ] ; then
+ SUPROG=/sbin/su
+elif [ -x /usr/bin/su ] ; then
+ SUPROG=/usr/bin/su
+elif [ -x /usr/sbin/su ] ; then
+ SUPROG=/usr/sbin/su
+else
+ SUPROG=/bin/su
+fi
+
# the command used to start
if [ "x$TORUSER" = "x" ]; then
START="$TORBIN -f $TORCONF $TORARGS"
else
- START="/bin/su -c \\"$TORBIN -f $TORCONF $TORARGS\\" $TORUSER"
+ START="$SUPROG -c \\"$TORBIN -f $TORCONF $TORARGS\\" $TORUSER"
fi
#