🚑 Move name variable up in script (#33)

Name is currently being used before set in the error handling.
This commit is contained in:
Paul Sinclair 2020-01-09 18:11:17 -05:00 committed by Franck Nijhof
parent 416ab1c2ef
commit 171064824a

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