From b68db41955e7b444795fa38ec4d268318f63d0c7 Mon Sep 17 00:00:00 2001 From: Patrick Kishino Date: Wed, 17 Feb 2021 20:44:36 +0900 Subject: [PATCH] Fixed duplicate default route drop causing problems (#1723) --- openvpn/tunnelUp.sh | 4 +--- transmission/start.sh | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openvpn/tunnelUp.sh b/openvpn/tunnelUp.sh index 530ce3489..e8aa1b5d3 100755 --- a/openvpn/tunnelUp.sh +++ b/openvpn/tunnelUp.sh @@ -18,7 +18,7 @@ if [ "${PEER_DNS}" != "no" ]; then fi i=$((${i} + 1)) done -if [ -n "${NS}" ] ; then + if [ -n "${NS}" ] ; then DNS="# Generated by openvpn for interface ${dev}\n" if [ -n "${SEARCH}" ] ; then DNS="${DNS}search ${DOMAIN} ${SEARCH}\n" @@ -37,8 +37,6 @@ if [ -n "${NS}" ] ; then chmod 644 /etc/resolv.conf fi fi - # Remove the original default route to avoid leaks. - route del default gw "${route_net_gateway}" fi /etc/transmission/start.sh "$@" diff --git a/transmission/start.sh b/transmission/start.sh index a0a077aff..85607466b 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -63,8 +63,9 @@ fi . /etc/transmission/userSetup.sh if [[ "true" = "$DROP_DEFAULT_ROUTE" ]]; then - echo "DROPPING DEFAULT ROUTE" - ip r del default || exit 1 + echo "DROPPING DEFAULT ROUTE" + # Remove the original default route to avoid leaks. + route del default gw "${route_net_gateway}" || exit 1 fi if [[ "true" = "$LOG_TO_STDOUT" ]]; then