diff --git a/package/etc/go_templates/source_network.t b/package/etc/go_templates/source_network.t index 5c7e8b4..6d7a6d3 100644 --- a/package/etc/go_templates/source_network.t +++ b/package/etc/go_templates/source_network.t @@ -2,7 +2,7 @@ syslog ( transport("udp") so-reuseport(1) - persist-name("{{.port_id}}{{.instance}}") + persist-name("{{ .port_id }}{{ .instance }}") port({{ getenv (print "SC4S_LISTEN_" .port_id "_UDP_PORT") "514" }}) ip-protocol(4) so-rcvbuf({{getenv "SC4S_SOURCE_UDP_SO_RCVBUFF" "1703936"}}) @@ -23,8 +23,9 @@ source s_{{ .port_id }} { channel { source { {{- if or (getenv (print "SC4S_LISTEN_" .port_id "_UDP_PORT")) (eq .port_id "DEFAULT") }} +{{- $port_id := .port_id }} {{- range (math.Seq (getenv "SC4S_SOURCE_LISTEN_UDP_SOCKETS" "5"))}} -{{- $context := dict "instance" . "port_id" "DEFAULT" }} +{{- $context := dict "instance" . "port_id" $port_id }} {{- template "UDP" $context }} {{- end}} {{- end}}