From 65aad59ef0802708a8a7c8a312755232cc1823d3 Mon Sep 17 00:00:00 2001 From: subh Date: Mon, 19 Jan 2026 21:47:02 +0530 Subject: initial commit --- scripts/vpn_connect.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/vpn_connect.sh (limited to 'scripts/vpn_connect.sh') diff --git a/scripts/vpn_connect.sh b/scripts/vpn_connect.sh new file mode 100755 index 0000000..d08b397 --- /dev/null +++ b/scripts/vpn_connect.sh @@ -0,0 +1,14 @@ +output=$(protonvpn connect) + +if echo "$output" | grep -q "Connection failed"; then + notify-send -u critical -i dialog-error "VPN Connection Status" "Failed to connect to VPN. Please check your network settings." +else + region=$(echo "$output" | awk '{print $3 ":" $12}') + + if [ -z "$region" ]; then + notify-send -u critical -i dialog-error "VPN Connection Status" "Failed to connect to VPN. Please check your connection settings." + else + notify-send -u normal -i network-wireless "VPN Connection Status" "Successfully connected to VPN. Region: $region" + fi +fi + -- cgit v1.2.3