Skip to content

Commit 5f7febd

Browse files
committed
Fix managed packet-forwarder config template.
1 parent cb02862 commit 5f7febd

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

cmd/lora-gateway-bridge/cmd/configfile.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,15 @@ type="{{ .Backend.Type }}"
4949
# the time would otherwise be unset.
5050
fake_rx_time={{ .Backend.SemtechUDP.FakeRxTime }}
5151
52-
# # Managed packet-forwarder configuration.
53-
# #
54-
# # By configuring one or multiple managed packet-forwarder sections, the
55-
# # LoRa Gateway Bridge updates the configuration when the backend receives
56-
# # a configuration change, after which it will restart the packet-forwarder.
57-
# [[packet_forwarder.configuration]]
52+
# Managed packet-forwarder configuration.
53+
#
54+
# By configuring one or multiple managed packet-forwarder sections, the
55+
# LoRa Gateway Bridge updates the configuration when the backend receives
56+
# a configuration change, after which it will restart the packet-forwarder.
57+
#
58+
# Example (this configuration can be repeated):
59+
#
60+
# [[backend.semtech_udp.configuration]]
5861
# # Gateway ID.
5962
# #
6063
# # The LoRa Gateway Bridge will only apply the configuration updates for this
@@ -82,6 +85,13 @@ type="{{ .Backend.Type }}"
8285
# # change. Make sure the LoRa Gateway Bridge process has sufficient
8386
# # permissions to execute this command.
8487
# restart_command="/etc/init.d/lora-packet-forwarder restart"
88+
{{ range $i, $config := .Backend.SemtechUDP.Configuration }}
89+
[[backend.semtech_udp.configuration]]
90+
gateway_id="{{ $config.GatewayID }}"
91+
base_file="{{ $config.BaseFile }}"
92+
output_file="{{ $config.OutputFile }}"
93+
restart_command="{{ $config.RestartCommand }}"
94+
{{ end }}
8595
8696
# Basic Station backend.
8797
[backend.basic_station]

0 commit comments

Comments
 (0)