index — dotfiles @ 8a3fab48c41d4d85f45f74b5a0806bf387cf515c

my dotfiles

bin/vpn_toggle (view raw)

 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