mirror of
https://github.com/hassio-addons/addon-wireguard.git
synced 2025-05-04 19:01:31 +00:00
🚑 Fixes issue with storage folders
This commit is contained in:
parent
a30992980f
commit
d557dda1ea
1 changed files with 6 additions and 1 deletions
|
@ -17,6 +17,11 @@ declare pre_shared_key
|
||||||
declare private_key
|
declare private_key
|
||||||
declare public_key
|
declare public_key
|
||||||
|
|
||||||
|
if ! bashio::fs.directory_exists '/ssl/wireguard'; then
|
||||||
|
mkdir -p /ssl/wireguard ||
|
||||||
|
bashio::exit.nok "Could create wireguard storage folder!"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[Interface]" > "${CONFIG}"
|
echo "[Interface]" > "${CONFIG}"
|
||||||
|
|
||||||
# Add all server addresses to the configuration
|
# Add all server addresses to the configuration
|
||||||
|
@ -113,7 +118,7 @@ for peer in $(bashio::config 'peers|keys'); do
|
||||||
|
|
||||||
addresses=$(bashio::config "peers[${peer}].addresses | join(\", \")")
|
addresses=$(bashio::config "peers[${peer}].addresses | join(\", \")")
|
||||||
dns=$(bashio::config "server.dns | join(\", \")")
|
dns=$(bashio::config "server.dns | join(\", \")")
|
||||||
public_key=$(wg pubkey < /data/private_key)
|
public_key=$(wg pubkey < /ssl/wireguard/private_key)
|
||||||
host=$(bashio::config 'server.host')
|
host=$(bashio::config 'server.host')
|
||||||
port=$(bashio::addon.port "51820/udp")
|
port=$(bashio::addon.port "51820/udp")
|
||||||
allowed_ips=$(bashio::config "peers[${peer}].allowed_ips | join(\", \")")
|
allowed_ips=$(bashio::config "peers[${peer}].allowed_ips | join(\", \")")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue