From a71d98590a21d84fbca51078a0f7085f0bcecb84 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:07:24 +0100 Subject: [PATCH] ovpn sanitization https://github.com/alexbelgium/hassio-addons/issues/1127 --- qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh b/qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh index 0843f7e4d..c5519b77a 100755 --- a/qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/00-openvpn.sh @@ -31,6 +31,13 @@ if [[ "$(bashio::config "VPN_ENABLED")" == "yes" ]] && [[ "$(bashio::config "VPN # Correct paths sed -i "s=/etc/openvpn=/config/openvpn=g" "$file" + + # Check if the last character in the file is a newline character + last_char=$(tail -c 1 "$file") + if [ "$last_char" != $'\n' ]; then + # Add a blank line at the end of the file + echo >> "$file" + fi fi done