fix(cistech-tunnel): reset DNS and clean tun interface before connecting
This commit is contained in:
@@ -376,6 +376,14 @@ connect_vpn() {
|
|||||||
# Kill any existing VPN processes
|
# Kill any existing VPN processes
|
||||||
kill_vpn_processes
|
kill_vpn_processes
|
||||||
|
|
||||||
|
# Reset DNS to public servers (VPN script may have overwritten it)
|
||||||
|
log DEBUG "Resetting DNS to public servers..."
|
||||||
|
echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
||||||
|
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||||
|
|
||||||
|
# Clean up stale tun interface
|
||||||
|
ip link delete tun0 2>/dev/null || true
|
||||||
|
|
||||||
# Validate required variables
|
# Validate required variables
|
||||||
if [[ -z "$VPN_HOST" ]]; then
|
if [[ -z "$VPN_HOST" ]]; then
|
||||||
log ERROR "VPN_HOST is not set"
|
log ERROR "VPN_HOST is not set"
|
||||||
|
|||||||
Reference in New Issue
Block a user