]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/tor
9c1dfc769285f282a926eca8ef230456e6652fff
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
26 if [ "${TOR_RELAY_ENABLED}" = "on" -a -n "${TOR_RELAY_DIRPORT}" ] && [ "${TOR_RELAY_DIRPORT}" -ne 0 ]; then
27 iptables
-A TOR_INPUT
-p tcp
--dport "${TOR_RELAY_DIRPORT}" -j ACCEPT
31 function flush_firewall
() {
38 tor_is_enabled ||
exit 0
43 boot_mesg
"Starting tor..."
44 loadproc
/usr
/bin
/tor \
46 --defaults-torrc /usr
/share
/tor
/defaults-torrc \
55 boot_mesg
"Stopping tor..."
63 boot_mesg
"Reloading tor..."
64 reloadproc
/usr
/bin
/tor
74 # Reload the process if it is already running. Otherwise, restart.
75 if pidofproc
-s /usr
/bin
/tor
; then
83 statusproc
/usr
/bin
/tor
87 echo "Usage: ${0} {start|stop|reload|restart|reload-or-restart|status}"
92 # End $rc_base/init.d/tor