summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-04-03 16:39:29 -0400
committerMicah Anderson <micah@riseup.net>2013-04-03 16:39:29 -0400
commitfbbcc3580bf337478e587db6a688e4b3efee3292 (patch)
treec4c1946233da670381ecb1028bd561593ba79565
parent9e209455b5ca957fc8c939d1222ba3abf66f0595 (diff)
update template to get rid of older (and unreliable) helper functions, these can lead to odd results when variables are explicitly set to undef, and should be avoided
-rw-r--r--templates/service.conf.erb16
1 files changed, 8 insertions, 8 deletions
diff --git a/templates/service.conf.erb b/templates/service.conf.erb
index d2fafaf..cdf5542 100644
--- a/templates/service.conf.erb
+++ b/templates/service.conf.erb
@@ -6,8 +6,8 @@
<%= 'debug = ' + debuglevel %>
<%= 'pid = ' + real_pid %>
<%- %w{chroot setuid setgid service compression}.each do |v|
- if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%>
-<%= v + " = " + instance_variable_get("@#{v}").to_s %>
+ if @v -%>
+<%= v + " = " + @v %>
<%-
end
end -%>
@@ -20,15 +20,15 @@ end -%>
<% end -%>
<%- %w{output syslog}.each do |v|
- if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%>
-<%= v + " = " + instance_variable_get("@#{v}").to_s %>
+ if @v -%>
+<%= v + " = " + @v %>
<%-
end
end -%>
<%- %w{egd engine enginectrl rndbytes rndfile rndoverwrite}.each do |v|
- if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%>
-<%= v + " = " + instance_variable_get("@#{v}").to_s %>
+ if @v -%>
+<%= v + " = " + @v %>
<%-
end
end -%>
@@ -39,8 +39,8 @@ end -%>
execargs failover ident key local oscp ocspflag options protocol protocolauthentication
protocolhost protocolpassword protocolusername pty retry session sslversion stack
timeoutbusy timeoutclose timeoutconnect timeoutidle transparent verify}.each do |v|
- if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%>
-<%= v + ' = ' + instance_variable_get("@#{v}").to_s %>
+ if @v -%>
+<%= v + ' = ' + @v %>
<%-
end
end -%>