Skip to content

Commit

Permalink
initial change to enable port ranges (Closes #107)
Browse files Browse the repository at this point in the history
  • Loading branch information
crayfishx committed Nov 30, 2016
1 parent a198381 commit 4b0524d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/service.xml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

<%- if @port -%>
<%- @port.each do |i| -%>
<port<% if i['protocol'] -%> protocol="<%= i['protocol'] %>"<% end -%><% if i['port'] -%> port="<%= i['port'] %>"<% end -%> />
<%- range = i['port'].split(/:/).map { |p| p.to_i } -%>
<%- (range[0]..range[1] || range[0]).each do |p| -%>
<port<% if i['protocol'] -%> protocol="<%= i['protocol'] %>"<% end -%> port="<%= p %>" />
<%- end -%>
<%- end -%>

<%- end -%>
Expand Down

0 comments on commit 4b0524d

Please sign in to comment.