summaryrefslogtreecommitdiff
path: root/contrib/tor.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tor.sh.in')
-rw-r--r--contrib/tor.sh.in14
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/tor.sh.in b/contrib/tor.sh.in
index b0a76314dd..2fc35b8410 100644
--- a/contrib/tor.sh.in
+++ b/contrib/tor.sh.in
@@ -24,6 +24,18 @@ if [ "x$TORGROUP" != "x" ]; then
fi
RETVAL=0
+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
+
case "$1" in
start)
@@ -36,7 +48,7 @@ case "$1" in
if [ "x$TORUSER" = "x" ]; then
$TORBIN -f $TORCONF $TORARGS
else
- /bin/su -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER
+ $SUPROG -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER
fi
RETVAL=$?
if [ $RETVAL -eq 0 ]; then