mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-16 01:18:19 +01:00
Update and rename 01-openvpn.sh to 00-openvpn.sh
This commit is contained in:
@@ -5,6 +5,11 @@ set -e
|
||||
mkdir -p /config/openvpn
|
||||
QBT_CONFIG_FILE="/config/qBittorrent/config/qBittorrent.conf"
|
||||
|
||||
# Ensure no redirection by removing the direction tag
|
||||
if [ -f "$QBT_CONFIG_FILE" ]; then
|
||||
sed -i '/Interface/d' "$QBT_CONFIG_FILE"
|
||||
fi
|
||||
|
||||
# Correct openvpn files
|
||||
if [[ "$(bashio::config "VPN_ENABLED")" == "yes" ]] && [[ "$(bashio::config "VPN_TYPE")" == "openvpn" ]]; then
|
||||
|
||||
@@ -20,16 +25,9 @@ if [[ "$(bashio::config "VPN_ENABLED")" == "yes" ]] && [[ "$(bashio::config "VPN
|
||||
done
|
||||
fi
|
||||
|
||||
# Add iproute
|
||||
ip route add 10.0.0.0/8 via 172.30.32.1
|
||||
ip route add 192.168.0.0/16 via 172.30.32.1
|
||||
ip route add 172.16.0.0/12 via 172.30.32.1
|
||||
|
||||
else
|
||||
|
||||
# Ensure no redirection by removing the direction tag
|
||||
if [ -f "$QBT_CONFIG_FILE" ]; then
|
||||
sed -i '/Interface/d' "$QBT_CONFIG_FILE"
|
||||
fi
|
||||
bashio::log.info "... direct connection without VPN enabled"
|
||||
|
||||
fi
|
||||
Reference in New Issue
Block a user