#! /bin/bash VPN="$1" if [[ -z "$VPN" ]]; then #echo "usage: ${0##*/} " >&2 #exit 1 VPN=$(nmcli --terse --fields NAME connection show | rofi -lines 20 -dmenu -i -p "network") fi ACTIVE=$(nmcli con show --active "$VPN") if [[ -z "$ACTIVE" ]]; then nmcli con up id "$VPN" else nmcli con down id "$VPN" fi exit 0