diff options
| author | subh <subh@example.com> | 2026-01-19 21:47:02 +0530 |
|---|---|---|
| committer | subh <subh@example.com> | 2026-01-19 21:47:02 +0530 |
| commit | 65aad59ef0802708a8a7c8a312755232cc1823d3 (patch) | |
| tree | fe0a437f3e9a71ab5b9197d9b8fa72c24d2170ea /scripts/vpn_connect.sh | |
initial commit
Diffstat (limited to 'scripts/vpn_connect.sh')
| -rwxr-xr-x | scripts/vpn_connect.sh | 14 |
1 files changed, 14 insertions, 0 deletions
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 + |
