]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/tor
2 ########################################################################
3 # Begin $rc_base/init.d/tor
5 # Description : Anonymizing overlay network for TCP
7 ########################################################################
12 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/tor
/settings
)
14 function tor_is_enabled
() {
15 [ "${TOR_ENABLED}" = "on" ] ||
[ "${TOR_RELAY_ENABLED}" = "on" ]
18 function setup_firewall
() {
22 if [ "${TOR_RELAY_ENABLED}" = "on" -a -n "${TOR_RELAY_PORT}" ]; then
23 iptables
-A TOR_INPUT
-p tcp
--dport "${TOR_RELAY_PORT}" -j ACCEPT
27 function flush_firewall
() {
34 tor_is_enabled ||
exit 0
39 boot_mesg
"Starting tor..."
40 loadproc
/usr
/bin
/tor \
42 --defaults-torrc /usr
/share
/tor
/defaults-torrc \
51 boot_mesg
"Stopping tor..."
59 boot_mesg
"Reloading tor..."
60 reloadproc
/usr
/bin
/tor
70 # Reload the process if it is already running. Otherwise, restart.
71 if pidofproc
-s /usr
/bin
/tor
; then
79 statusproc
/usr
/bin
/tor
83 echo "Usage: ${0} {start|stop|reload|restart|reload-or-restart|status}"
88 # End $rc_base/init.d/tor