1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006-2011 OpenWrt.org
13 if [ -f "$conf_path" ] || [ -d "$conf_path" ]; then
14 echo "%include $conf_path"
19 local default_conf generated_conf
22 config_get default_conf conf default "/etc/tor/torrc"
23 config_get generated_conf conf generated "/tmp/torrc"
24 TORRC_GEN="$generated_conf"
27 echo "## This file was automatically generated please do not edit here !"
28 config_list_foreach "conf" head_include handle_conf_file
29 echo "%include $default_conf"
30 config_list_foreach "conf" tail_include handle_conf_file
35 procd_send_signal /usr/sbin/tor
39 mkdir -m 0700 -p /var/lib/tor
40 chown -R tor:tor /var/lib/tor
42 mkdir -m 0755 -p /var/log/tor
43 chown -R tor:tor /var/log/tor
48 procd_set_param command /usr/sbin/tor --runasdaemon 0
49 procd_append_param command -f "$TORRC_GEN"
50 procd_set_param respawn