mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-30 04:14:04 +02:00
Update 00-openvpn.sh
This commit is contained in:
@@ -20,6 +20,7 @@ if [[ "$(bashio::config "VPN_ENABLED")" == "yes" ]] && [[ "$(bashio::config "VPN
|
|||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
|
|
||||||
# Convert to unix
|
# Convert to unix
|
||||||
|
echo "... converting to unix format $file"
|
||||||
dos2unix "$file"
|
dos2unix "$file"
|
||||||
|
|
||||||
# Remove route-nopull
|
# Remove route-nopull
|
||||||
@@ -28,21 +29,8 @@ if [[ "$(bashio::config "VPN_ENABLED")" == "yes" ]] && [[ "$(bashio::config "VPN
|
|||||||
sed -i "/route-nopull/d" "$file"
|
sed -i "/route-nopull/d" "$file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Avoid ipv6
|
|
||||||
sed -i "/ipv6/d" "$file"
|
|
||||||
|
|
||||||
# Correct paths
|
# Correct paths
|
||||||
sed -i "s=/etc/openvpn=/config/openvpn=g" "$file"
|
sed -i "s=/etc/openvpn=/config/openvpn=g" "$file"
|
||||||
|
|
||||||
# Check proto
|
|
||||||
if grep -q "proto" "$file"; then
|
|
||||||
if [ -f /data/tdp ]; then
|
|
||||||
echo "... proto not found in your ovpn, assuming TDP"
|
|
||||||
sed -i "250a VPN_PROTOCOL=\"udp\"" /etc/cont-init.d/02-vpn.sh
|
|
||||||
else
|
|
||||||
echo "... proto not found in your ovpn, assuming UDP"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user