summary refs log tree commit diff stats
path: root/bin/vpn_toggle
blob: 201b59e1d8339c0d4cb679a2c3f7daa6bc0e1424 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

out=$(sudo wg)

if [ "$1" == "-i" ]
then
    if [ -n "$out" ]
    then
        notify-send "vpn is activated"
    else
        notify-send "vpn is deactivated"
    fi
    exit
fi

if [ -n "$out" ]
then
    sudo wg-quick down /etc/wireguard/schwitz.conf
    echo "vpn is deactivated"
else
    sudo wg-quick up /etc/wireguard/schwitz.conf
    echo "vpn is activated"
fi