Skip to content
Snippets Groups Projects
Commit c902b017 authored by Russ Allbery's avatar Russ Allbery
Browse files

Support passing newsyslog::config logs as a string

Allow logs to be set to a single log as a string by coercing logs
to a flattened array.  Do the same for the analyze_logs parameter.
parent 6654b270
No related branches found
No related tags found
No related merge requests found
......@@ -15,14 +15,14 @@ set archive = <%= archive %>/%Y/%M/%d/%m.%n
<% if stop != '' || restart != '' then -%>
<% end -%>
<% logs.each do |log| -%>
<% [logs].flatten.each do |log| -%>
<% log_name = log.gsub(/[\.\-\<\>]/, '_') -%>
<% path = directory + '/' + log -%>
<% perms = [log_owner, log_group, log_mode].join(' ') -%>
log: <%= log_name %> <%= path %> <%= perms %>
<% end -%>
<% logs.each do |log| -%>
<% [logs].flatten.each do |log| -%>
<% log_name = log.gsub(/[\.\-\<\>]/, '_') -%>
archive: <%= log_name %> save <%= save_num %>
<% if archive != '' then -%>
......@@ -32,7 +32,7 @@ set archive = <%= archive %>/%Y/%M/%d/%m.%n
<% if analyze != '' then -%>
<% alogs = analyze_logs.to_a.empty? ? logs : analyze_logs -%>
<% alogs.each do |log| -%>
<% [alogs].flatten.each do |log| -%>
<% log_name = log.gsub(/[\.\-\<\>]/, '_') -%>
analyze: <%= log_name %> <%= analyze %>
<% end -%>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment