summaryrefslogtreecommitdiff
path: root/scripts/vpn_connect.sh
blob: d08b3973d9bd448182ea21d07de49ffe580cd917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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