I suspect that while the inline read was shorter, it was leaking fds
[mirror/dsa-puppet.git] / templates / motd.erb
index 3675161..a0a7a72 100644 (file)
@@ -1,8 +1,10 @@
 This device is for authorized users only.  All traffic on this device
 is monitored and will be used as evidence for prosecutions.
 
-<% if File.exists?("/etc/puppet/modules/motd/files/" + fqdn "/motd.tail") -%>
+<% if File.exists?("/etc/puppet/modules/motd/files/" + fqdn "/motd.tail") -%>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-<% File.open("/etc/puppet/modules/motd/files/" + fqdn + "/motd.tail").read -%>
+<% f = File.open("/etc/puppet/modules/motd/files/" + fqdn + "/motd.tail") -%>
+<%= f.read -%>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+<% f.close -%>
 <% end -%>