You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
293 B

#!/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