mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-18 06:41:51 +02:00
Update 00-openvpn.sh
This commit is contained in:
@@ -16,12 +16,29 @@ if [[ "$(bashio::config "VPN_ENABLED")" == "yes" ]] && [[ "$(bashio::config "VPN
|
|||||||
# If there is a config file, remove nopull
|
# If there is a config file, remove nopull
|
||||||
if [ -n "$(ls -A /config/openvpn 2>/dev/null)" ]; then
|
if [ -n "$(ls -A /config/openvpn 2>/dev/null)" ]; then
|
||||||
for file in /config/openvpn/*.ovpn; do
|
for file in /config/openvpn/*.ovpn; do
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
|
|
||||||
|
# Remove route-nopull
|
||||||
if grep -q route-nopull "$file"; then
|
if grep -q route-nopull "$file"; then
|
||||||
echo "... removing route-nopull from $file"
|
echo "... removing route-nopull from $file"
|
||||||
sed -i "/route-nopull/d" "$file"
|
sed -i "/route-nopull/d" "$file"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
# Avoid ipv6
|
||||||
|
sed -i "/proto udp/c proto udp4" "$file"
|
||||||
|
sed -i "/proto tcp/c proto tcp4" "$file"
|
||||||
|
sed -i "/route-ipv6/d" "$file"
|
||||||
|
sed -i "/ifconfig-ipv6/d" "$file"
|
||||||
|
sed -i "6a pull-filter ignore \"route-ipv6\"" "$file"
|
||||||
|
sed -i "6a pull-filter ignore \"ifconfig-ipv6\"" "$file"
|
||||||
|
|
||||||
|
# Check proto
|
||||||
|
if grep -q "proto" "$file"; then
|
||||||
|
echo "... proto not found in your ovpn, assuming UDP"
|
||||||
|
touch /data/udp
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user