mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
Refactor WireGuard script to remove port mapping
Removed port mapping logic for WireGuard and added IP retrieval.
This commit is contained in:
@@ -23,13 +23,6 @@ if bashio::config.true 'openvpn_alt_mode'; then
|
||||
bashio::log.warning 'The openvpn_alt_mode option is ignored when WireGuard is enabled.'
|
||||
fi
|
||||
|
||||
port="$(bashio::addon.port '51820/udp' || true)"
|
||||
if bashio::var.has_value "${port}"; then
|
||||
bashio::log.info "WireGuard host port ${port}/udp mapped to container port 51820."
|
||||
else
|
||||
bashio::log.info 'WireGuard port 51820/udp is not exposed in the add-on options. Continuing with outbound-only connectivity.'
|
||||
fi
|
||||
|
||||
if bashio::config.has_value 'wireguard_config'; then
|
||||
configured_name="$(bashio::config 'wireguard_config')"
|
||||
configured_name="${configured_name##*/}"
|
||||
@@ -83,4 +76,7 @@ else
|
||||
bashio::log.warning "qBittorrent config file not found. Bind the client manually to interface ${interface_name}."
|
||||
fi
|
||||
|
||||
# Get current ip
|
||||
curl -s ipecho.net/plain > /currentip
|
||||
|
||||
bashio::log.info "WireGuard prepared with interface ${interface_name} using configuration ${wireguard_config##*/}."
|
||||
|
||||
Reference in New Issue
Block a user