-service <%= scope.lookupvar('port') %>
+service <%= scope.lookupvar('service') %>
{
<%- if scope.lookupvar('bind') != '' -%>
bind = <%= scope.lookupvar('bind') %>
<%- end -%>
<%- if scope.lookupvar('type') != '' -%>
type = <%= scope.lookupvar('type') %>
+<%- end -%>
+<%- if scope.lookupvar('port') != '' -%>
+ port = <%= scope.lookupvar('port') %>
<%- end -%>
id = <%= scope.lookupvar('id') %>
protocol = <%= scope.lookupvar('protocol') %>
<%- if scope.lookupvar('flags') != '' -%>
flags = <%= scope.lookupvar('flags') %>
-<%- elsif scope.lookupvar('bind') =~ ':' -%>
+<%- elsif scope.lookupvar('bind') =~ /:/ or scope.lookupvar('bind') == "" -%>
flags = IPv6
<%- end -%>
wait = <%= scope.lookupvar('wait') %>