Update 01-openvpn.sh

This commit is contained in:
Alexandre
2023-12-11 16:25:38 +01:00
committed by GitHub
parent 5352b23671
commit 4ac8a3dea8

View File

@@ -10,10 +10,14 @@ if [ bashio::config "VPN_ENABLED" == "yes" ]; then
# If there is a config file, add nopull # If there is a config file, add nopull
if [ -n "$(ls -A /config/openvpn 2>/dev/null)" ]; then if [ -n "$(ls -A /config/openvpn 2>/dev/null)" ]; then
if ! grep -q route-nopull /etc/openvpn/config.ovpn; then for file in /config/openvpn/*; do
echo "... adding route-nopull to your config.ovpn" if [ -f "$file" ]; then
sed -i "1a route-nopull" /etc/openvpn/config.ovpn if ! grep -q route-nopull "$file"; then
fi echo "... adding route-nopull to $file"
sed -i "1a route-nopull" "$file"
fi
fi
done
fi fi
else else