diff options
Diffstat (limited to 'templates/torrc.global.erb')
-rw-r--r-- | templates/torrc.global.erb | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/templates/torrc.global.erb b/templates/torrc.global.erb index 0bc3bf2..c320bfa 100644 --- a/templates/torrc.global.erb +++ b/templates/torrc.global.erb @@ -1,15 +1,21 @@ # runtime RunAsDaemon 1 -DataDirectory <%= scope.lookupvar('tor::daemon::data_dir') %> +<% if (v=scope.lookupvar('tor::daemon::data_dir')) != '/var/lib/tor' -%> +DataDirectory <%= v %> +<% end -%> # log -<%- if scope.lookupvar('tor::daemon::log_rules') != [] then -%> -<%- for log_rule in scope.lookupvar('tor::daemon::log_rules') -%> -Log <%= log_rule %> -<%- end -%> -<%- else -%> +<% if (rules=scope.lookupvar('tor::daemon::log_rules')).empty? -%> Log notice syslog -<%- end -%> +<% else -%> +<% rules.each do |log_rule| -%> +Log <%= log_rule %> +<% end -%> +<% end -%> -AutomapHostsOnResolve <%= scope.lookupvar('tor::daemon::automap_hosts_on_resolve') %> -UseBridges <%= scope.lookupvar('tor::daemon::use_bridges') %> +<% if (v=scope.lookupvar('tor::daemon::automap_hosts_on_resolve')) != '0' -%> +AutomapHostsOnResolve <%= v %> +<% end -%> +<% if (v=scope.lookupvar('tor::daemon::use_bridges')) != '0' -%> +UseBridges <%= v %> +<%- end -%> |