From ddeadf407a1400d9fde686a607d4031d7e2a99bc Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 11 Dec 2023 17:54:31 +0100 Subject: [PATCH] Update 00-openvpn.sh --- .../rootfs/etc/cont-init.d/00-openvpn.sh | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh b/qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh index b7de353f9..3e2456a94 100755 --- a/qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh @@ -16,12 +16,29 @@ if [[ "$(bashio::config "VPN_ENABLED")" == "yes" ]] && [[ "$(bashio::config "VPN # If there is a config file, remove nopull if [ -n "$(ls -A /config/openvpn 2>/dev/null)" ]; then for file in /config/openvpn/*.ovpn; do - if [ -f "$file" ]; then + if [ -f "$file" ]; then + + # Remove route-nopull if grep -q route-nopull "$file"; then echo "... removing route-nopull from $file" sed -i "/route-nopull/d" "$file" fi - fi + + # Avoid ipv6 + sed -i "/proto udp/c proto udp4" "$file" + sed -i "/proto tcp/c proto tcp4" "$file" + sed -i "/route-ipv6/d" "$file" + sed -i "/ifconfig-ipv6/d" "$file" + sed -i "6a pull-filter ignore \"route-ipv6\"" "$file" + sed -i "6a pull-filter ignore \"ifconfig-ipv6\"" "$file" + + # Check proto + if grep -q "proto" "$file"; then + echo "... proto not found in your ovpn, assuming UDP" + touch /data/udp + fi + + fi done fi