From 896edef56b2d8ca3ceacb021306e70d0d5cee7c0 Mon Sep 17 00:00:00 2001 From: Paul Sinclair Date: Thu, 9 Jan 2020 16:58:11 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91Move=20name=20variable=20up=20in=20?= =?UTF-8?q?script=20Name=20is=20currently=20being=20used=20before=20set=20?= =?UTF-8?q?in=20the=20error=20handling.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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")