From cc0bba289b738d68d1b1c443cc8ed31f578c3fcb Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 21 Jan 2024 12:45:21 +0100 Subject: [PATCH] Update 93-openvpn.sh --- qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh b/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh index 7a43f4f70..6afa5b726 100755 --- a/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh @@ -56,9 +56,13 @@ if bashio::config.true 'openvpn_enabled'; then # Check if the line contains a txt file ####################################### - if [[ ! $line =~ ^"#" ]] && [[ ! $line =~ ^";" ]] && [[ "$line" == *" "*"."* ]] || [[ "$line" == "auth-user-pass"* ]]; then + if [[ ! $line =~ ^"#" ]] && [[ ! $line =~ ^";" ]] && [[ "$line" =~ *" "*"."[a-z]* ]] || [[ "$line" == "auth-user-pass"* ]]; then # Extract the txt file name from the line file_name="$(echo "$line" | awk -F' ' '{print $2}')" + # if contains only numbers and dots it is likely an ip, don't check it + if [[ "$file_name" =~ ^[0-9\.]+$ ]]; then + continue + fi # Check if the txt file exists if [[ "$file_name" != *"/etc/openvpn/credentials"* ]] && [ ! -f "$file_name" ]; then # Check if the txt file exists in the /config/openvpn/ directory