Refactor WireGuard script to remove port mapping

Removed port mapping logic for WireGuard and added IP retrieval.
This commit is contained in:
Alexandre
2025-11-19 15:29:14 +01:00
committed by GitHub
parent 39d646005a
commit 27241c1885

View File

@@ -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##*/}."