commit d99f2d53f61f8596becd4d509d3d141e4e740fe2 parent fda53c45114fe99fdafee2c59f7bee8c893df4a0 Author: Vincent Demeester <vincent@sbr.pm> Date: Fri, 29 Apr 2022 18:38:02 +0200 nix/packages/scripts: fix redhat-vpn Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | nix/packages/my/scripts/bin/redhat-vpn | | | 7 | ++++--- |
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/nix/packages/my/scripts/bin/redhat-vpn b/nix/packages/my/scripts/bin/redhat-vpn @@ -9,16 +9,17 @@ if ! timeout 1s xset q &>/dev/null; then GRAPHICS=0 fi -CHOOSE_CMD="zenity --list --title \"Red Hat VPNs\" --text \"Choose your VPN..\" --column \"Name\" --width=600 --height=450" if [[ GRAPHICS -eq 0 ]]; then - CHOOSE_CMD="fzf" + connection=$(nmcli connection show | grep vpn | fzf) +else + connection=$(nmcli connection show | grep vpn | zenity --list --title "Red Hat VPNs" --text "Choose your VPN.." --column "Name" --width=600 --height=450) fi NOTIFY_CMD="notify-send" if [[ GRAPHICS -eq 0 ]]; then NOTIFY_CMD="echo" fi -connection=$(nmcli connection show | grep vpn | $CHOOSE_CMD) + uuid=$(echo ${connection} | awk '{print $3}') name=$(echo ${connection} | awk '{print $1 $2}') VPNSTATUS=$(nmcli connection show --active $uuid | wc -l)