From 1f7b8cf4d804ae09f15b18d3aa445898534315c5 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Tue, 14 Apr 2020 17:47:11 +0200 Subject: [PATCH] adding vpnmenu --- .local/bin/etc/vpnmenu | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 .local/bin/etc/vpnmenu diff --git a/.local/bin/etc/vpnmenu b/.local/bin/etc/vpnmenu new file mode 100755 index 0000000..c294f80 --- /dev/null +++ b/.local/bin/etc/vpnmenu @@ -0,0 +1,7 @@ +#!/bin/sh + +active=$(nmcli connection show --active | grep vpn | cut -d' ' -f1) +[[ ! -z "$active" ]] && { prompt "disconnect from $active?" || exit 1; } +[[ ! -z "$active" ]] && nmcli connection down $active +conn=$(nmcli connection | grep vpn | cut -d' ' -f1 | dmenu) +nmcli connection up $conn