"Fossies" - the Fresh Open Source Software Archive

Member "tor-0.4.1.6/contrib/dist/rc.subr" (10 Jun 2019, 1110 Bytes) of package /linux/misc/tor-0.4.1.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 # $FreeBSD: ports/security/tor-devel/files/tor.in,v 1.1 2006/02/17 22:21:25 mnag Exp $
    3 #
    4 # (rc.subr written by Peter Thoenen for Net/FreeBSD)
    5 #
    6 # REQUIRE: NETWORKING SERVERS USR
    7 # BEFORE: LOGIN
    8 #
    9 # Add the following lines to /etc/rc.conf to enable tor
   10 #
   11 # tor_enable (bool):    Set to "NO" by default
   12 #                       Set it to "YES" to enable tor
   13 # tor_conf (str):       Points to your tor conf file
   14 #                       Default: /usr/local/etc/tor/torrc
   15 # tor_user (str):       Tor Daemon user. Default _tor
   16 #
   17 
   18 . /etc/rc.subr
   19 
   20 name="tor"
   21 rcvar=${name}_enable
   22 
   23 load_rc_config ${name}
   24 
   25 : ${tor_enable="NO"}
   26 : ${tor_conf="/usr/local/etc/tor/torrc"}
   27 : ${tor_user="_tor"}
   28 : ${tor_pidfile="/var/run/tor/tor.pid"}
   29 : ${tor_logfile="/var/log/tor"}
   30 : ${tor_datadir="/var/run/tor"}
   31 
   32 required_files=${tor_conf}
   33 required_dirs=${tor_datadir}
   34 command="/usr/local/bin/${name}"
   35 command_args="-f ${tor_conf} --pidfile ${tor_pidfile} --runasdaemon 1 --datadirectory ${tor_datadir} --user ${tor_user}"
   36 extra_commands="log"
   37 log_cmd="${name}_log"
   38 
   39 tor_log() {
   40         cat ${tor_logfile}
   41 }
   42 
   43 run_rc_command "$1"