From 171064824ac7d20ddbac83b62cce499c5e917ac0 Mon Sep 17 00:00:00 2001 From: Paul Sinclair <24625998+sinclairpaul@users.noreply.github.com> Date: Thu, 9 Jan 2020 18:11:17 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20Move=20name=20variable=20up=20in?= =?UTF-8?q?=20script=20(#33)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Name is currently being used before set in the error handling. --- wireguard/rootfs/etc/cont-init.d/config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wireguard/rootfs/etc/cont-init.d/config.sh b/wireguard/rootfs/etc/cont-init.d/config.sh index e3939c1..1c98b75 100644 --- a/wireguard/rootfs/etc/cont-init.d/config.sh +++ b/wireguard/rootfs/etc/cont-init.d/config.sh @@ -175,12 +175,13 @@ fi # Fetch all the peers for peer in $(bashio::config 'peers|keys'); do + name=$(bashio::config "peers[${peer}].name") + # Check if at least 1 address is specified if ! bashio::config.has_value "peers[${peer}].addresses"; then bashio::exit.nok "You need at least 1 address configured for ${name}" fi - name=$(bashio::config "peers[${peer}].name") config_dir="/ssl/wireguard/${name}" endpoint=$(bashio::config "peers[${peer}].endpoint") fwmark=$(bashio::config "peers[${peer}].fwmark")