🚑Move name variable up in script

Name is currently being used before set in the error handling.
This commit is contained in:
Paul Sinclair 2020-01-09 16:58:11 -05:00
parent 416ab1c2ef
commit 896edef56b
No known key found for this signature in database
GPG key ID: 779C7A23E1AA845D

View file

@ -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")