From 3d2d275cb2f44a01c3ec91af79407508396809a2 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 8 Feb 2026 13:15:35 +0100 Subject: [PATCH] Fix ipv6 endpoints resolve --- qbittorrent/rootfs/usr/local/sbin/vpn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qbittorrent/rootfs/usr/local/sbin/vpn b/qbittorrent/rootfs/usr/local/sbin/vpn index e0554c5d5..bc5d133c5 100755 --- a/qbittorrent/rootfs/usr/local/sbin/vpn +++ b/qbittorrent/rootfs/usr/local/sbin/vpn @@ -230,10 +230,14 @@ _wireguard_up() { fi _cmd "wg set ${config["Interface"]} listen-port ${config["ListenPort"]} private-key ${config["PrivateKey"]}" || return 1 + local endpoint="${config["EndpointIP"]}:${config["EndpointPort"]}" + if [[ "${config["EndpointIP"]}" == *:* ]]; then + endpoint="[${config["EndpointIP"]}]:${config["EndpointPort"]}" + fi if [ -v config["PersistentKeepalive"] ] && [ -n "${config["PersistentKeepalive"]}" ]; then - _cmd "wg set ${config["Interface"]} peer ${config["PublicKey"]} endpoint ${config["EndpointIP"]}:${config["EndpointPort"]} allowed-ips ${allowed_ips} persistent-keepalive ${config["PersistentKeepalive"]}" || return 1 + _cmd "wg set ${config["Interface"]} peer ${config["PublicKey"]} endpoint ${endpoint} allowed-ips ${allowed_ips} persistent-keepalive ${config["PersistentKeepalive"]}" || return 1 else - _cmd "wg set ${config["Interface"]} peer ${config["PublicKey"]} endpoint ${config["EndpointIP"]}:${config["EndpointPort"]} allowed-ips ${allowed_ips}" || return 1 + _cmd "wg set ${config["Interface"]} peer ${config["PublicKey"]} endpoint ${endpoint} allowed-ips ${allowed_ips}" || return 1 fi if [ -v config["MTU"] ] && [ -n "${config["MTU"]}" ]; then