From bb46ba091a5fba5da8abb34ddb3a219b705b9b52 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Fri, 25 Mar 2022 09:16:26 -0300 Subject: [PATCH] Get and reactivate netDevice --- dotfiles/.local/bin/vpndisconnect | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dotfiles/.local/bin/vpndisconnect b/dotfiles/.local/bin/vpndisconnect index 60a9520..f9b8275 100755 --- a/dotfiles/.local/bin/vpndisconnect +++ b/dotfiles/.local/bin/vpndisconnect @@ -1,8 +1,7 @@ #!/bin/sh protonvpn-cli d -#nmcli device down enp3s0 -nmcli networking off -#sleep 1 -#nmcli device up enp3s0 -nmcli networking on +netDevice="$(ip -4 route ls | awk '/^default/{print $5}')" +nmcli device down "$netDevice" +sleep 1 +nmcli device up "$netDevice"