From d7f1bc1917edec4440f41d6ef638c1e221186ea6 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan <79687674+Saumit-D@users.noreply.github.com> Date: Mon, 29 Nov 2021 20:43:06 +0530 Subject: Update vpn-menu --- scripts/vpn-menu | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'scripts') diff --git a/scripts/vpn-menu b/scripts/vpn-menu index 251fd7e..1862205 100644 --- a/scripts/vpn-menu +++ b/scripts/vpn-menu @@ -1,28 +1,5 @@ -//doesnt work improve in future - #!/bin/sh -echo "Choose a country...1)US 2)NL 3)JP" -country=("US" "NL" "JP") -select chosen in "${country[@]}"; do - case $chosen in - "US") - echo "Choosing Fastest Virtualized Private American server" - usvpn=$(find /etc/openvpn/client/ -type f | shuf -n 1) - sudo openvpn /etc/openvpn/client/$usvpn - break - ;; - "NL") - echo "Choosing Fastest Virtualized Private NewZealand's server" - nlvpn=$(find /etc/openvpn/client/nl -type f | shuf -n 1) - sudo openvpn --config /etc/openvpn/client/$nlvpn - break - ;; - "JP") - echo "Choosing Fastest Virtualized Private Japanese server" - jpvpn=$(find /etc/openvpn/client/jp -type f | shuf -n 1) - sudo openvpn --config /etc/openvpn/client/$jpvpn - break - ;; - *) echo "invalid option $REPLY";; - esac -done + +vpnid=$(nmcli con | grep "vpn" | cut -d " " -f 1 | dmenu -p "Select VPN to activate/deactivate") +actdeact=$(echo "" | dmenu -p "Activate or Deactivate? (up or down)") +nmcli con $actdeact id $vpnid -- cgit v1.2.3