mirror of
https://github.com/hassio-addons/addon-wireguard.git
synced 2025-05-04 19:01:31 +00:00
🚑 Move name variable up in script (#33)
Name is currently being used before set in the error handling.
This commit is contained in:
parent
416ab1c2ef
commit
171064824a
1 changed files with 2 additions and 1 deletions
|
@ -175,12 +175,13 @@ fi
|
||||||
# Fetch all the peers
|
# Fetch all the peers
|
||||||
for peer in $(bashio::config 'peers|keys'); do
|
for peer in $(bashio::config 'peers|keys'); do
|
||||||
|
|
||||||
|
name=$(bashio::config "peers[${peer}].name")
|
||||||
|
|
||||||
# Check if at least 1 address is specified
|
# Check if at least 1 address is specified
|
||||||
if ! bashio::config.has_value "peers[${peer}].addresses"; then
|
if ! bashio::config.has_value "peers[${peer}].addresses"; then
|
||||||
bashio::exit.nok "You need at least 1 address configured for ${name}"
|
bashio::exit.nok "You need at least 1 address configured for ${name}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
name=$(bashio::config "peers[${peer}].name")
|
|
||||||
config_dir="/ssl/wireguard/${name}"
|
config_dir="/ssl/wireguard/${name}"
|
||||||
endpoint=$(bashio::config "peers[${peer}].endpoint")
|
endpoint=$(bashio::config "peers[${peer}].endpoint")
|
||||||
fwmark=$(bashio::config "peers[${peer}].fwmark")
|
fwmark=$(bashio::config "peers[${peer}].fwmark")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue