From 27241c1885de61adefa67b5446d45161eb850358 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 19 Nov 2025 15:29:14 +0100 Subject: [PATCH] Refactor WireGuard script to remove port mapping Removed port mapping logic for WireGuard and added IP retrieval. --- qbittorrent/rootfs/etc/cont-init.d/94-wireguard.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/qbittorrent/rootfs/etc/cont-init.d/94-wireguard.sh b/qbittorrent/rootfs/etc/cont-init.d/94-wireguard.sh index 98a553de8..058be6e97 100755 --- a/qbittorrent/rootfs/etc/cont-init.d/94-wireguard.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/94-wireguard.sh @@ -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##*/}."