From 397fb7304816101027834c95cb43b5cb6d3b17ea Mon Sep 17 00:00:00 2001 From: meliurwen Date: Sun, 30 Aug 2020 14:05:29 +0200 Subject: [PATCH] Fixed issue that prevented the DNS-only VPN to be set up correctly --- bin/start.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/start.sh b/bin/start.sh index 6dde210..80280eb 100644 --- a/bin/start.sh +++ b/bin/start.sh @@ -51,10 +51,12 @@ else fi fi +# Replace the whole line +# If DNS_ONLY is true make sure is commented, else make sure is uncommented if [[ "$DNS_ONLY" = 'y' ]]; then - sed -i 's/#push "redirect-gateway def1 bypass-dhcp"/push "redirect-gateway def1 bypass-dhcp"/g' ${OPENVPN_CONFIG_FILE} + sed -i '/push "redirect-gateway def1 bypass-dhcp"/c\#push "redirect-gateway def1 bypass-dhcp"' ${OPENVPN_CONFIG_FILE} else - sed -i 's/push "redirect-gateway def1 bypass-dhcp"/push "redirect-gateway def1 bypass-dhcp"/g' ${OPENVPN_CONFIG_FILE} + sed -i '/push "redirect-gateway def1 bypass-dhcp"/c\push "redirect-gateway def1 bypass-dhcp"' ${OPENVPN_CONFIG_FILE} fi