Update 00-openvpn.sh

This commit is contained in:
Alexandre
2023-12-14 17:30:13 +01:00
committed by GitHub
parent 658d2afa6b
commit 4652dda4da

View File

@@ -32,13 +32,9 @@ 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
# Remove blank characters and add a trailing blank line
sed -i '/^[[:space:]]*$/d' "$file"
echo "" >> "$file"
fi
done
fi