Skip to content

Commit

Permalink
Update and rename 01-openvpn.sh to 00-openvpn.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbelgium authored Dec 11, 2023
1 parent d808f30 commit 2cb84c2
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit 2cb84c2

Please sign in to comment.