mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-01 11:46:07 +02:00
ovpn sanitization
https://github.com/alexbelgium/hassio-addons/issues/1127
This commit is contained in:
@@ -31,6 +31,13 @@ if [[ "$(bashio::config "VPN_ENABLED")" == "yes" ]] && [[ "$(bashio::config "VPN
|
|||||||
|
|
||||||
# Correct paths
|
# Correct paths
|
||||||
sed -i "s=/etc/openvpn=/config/openvpn=g" "$file"
|
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
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user