123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- #!/bin/sh
- . /etc/rc.status
- rc_reset
- ulimit -n 8192
- TORCTL=@BINDIR@/torctl
- TORUSER=@TORUSER@
- export TORUSER
- TORGROUP=@TORGROUP@
- export TORGROUP
- TOR_DAEMON_PID_DIR="@LOCALSTATEDIR@/run/tor"
- 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)
- echo "Starting tor daemon"
- if [ ! -d $TOR_DAEMON_PID_DIR ] ; then
- mkdir -p $TOR_DAEMON_PID_DIR
- chown $TORUSER:$TORGROUP $TOR_DAEMON_PID_DIR
- fi
-
-
- startproc -f $TORCTL start
-
- rc_status -v
- ;;
- stop)
- echo "Stopping tor daemon"
- startproc -f $TORCTL stop
-
- rc_status -v
- ;;
- restart)
- echo "Restarting tor daemon"
- startproc -f $TORCTL restart
-
- rc_status -v
- ;;
- reload)
- echo "Reloading tor daemon"
- startproc -f $TORCTL reload
-
- rc_status -v
- ;;
- status)
- startproc -f $TORCTL status
-
- rc_status -v
- ;;
- *)
- echo "Usage: $0 (start|stop|restart|reload|status)"
- RETVAL=1
- esac
- rc_exit
|