Skip to content

Commit

Permalink
πŸš‘ Move name variable up in script (#33)
Browse files Browse the repository at this point in the history
Name is currently being used before set in the error handling.
  • Loading branch information
sinclairpaul authored and frenck committed Jan 9, 2020
1 parent 416ab1c commit 1710648
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wireguard/rootfs/etc/cont-init.d/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 1710648

Please sign in to comment.