From 0bb1fefcbfca6a56cf2fe59fd103ea929a90c49d Mon Sep 17 00:00:00 2001 From: FURK4NGG <105324908+FURK4NGG@users.noreply.github.com> Date: Sat, 25 Jul 2026 14:58:49 +0300 Subject: [PATCH] Create vpn.sh --- .config/scripts/vpn.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .config/scripts/vpn.sh diff --git a/.config/scripts/vpn.sh b/.config/scripts/vpn.sh new file mode 100644 index 0000000..98d2f2d --- /dev/null +++ b/.config/scripts/vpn.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +VPN_NAME="wg0" + +if nmcli -t -f NAME connection show --active | grep -Fxq "$VPN_NAME"; then + if nmcli connection down "$VPN_NAME"; then + notify-send "VPN" "$VPN_NAME disconnected" + else + notify-send -u critical "VPN Error" "Failed to disconnect $VPN_NAME" + exit 1 + fi +else + if nmcli connection up "$VPN_NAME"; then + notify-send "VPN" "$VPN_NAME connected" + else + notify-send -u critical "VPN Error" "Failed to connect $VPN_NAME" + exit 1 + fi +fi