try to start breaking up firewall rules into something not quite as messy
[mirror/dsa-puppet.git] / modules / motd / templates / motd.erb
index 6ac169c..37d9b4f 100644 (file)
@@ -5,9 +5,13 @@ is monitored and will be used as evidence for prosecutions.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 <%=
+def wrap(s, width=78)
+      s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
+end
+
 purp = ''
 if nodeinfo.has_key?('nameinfo')
-  purp += nodeinfo['nameinfo'] + "\n\n"
+  purp += wrap(nodeinfo['nameinfo']) + "\n\n"
 end
 
 purp += 'Welcome to ' + fqdn