blob: e1eb2055e8ee214d0e9c9a0e54dab488eda5087c (
plain) (
tree)
|
|
#!/bin/sh
note()
{
command -v notify-send > /dev/null &&
notify-send " vpn" "$1"
printf "\n%s\n" "$1"
}
wg_conf="${1:-kay}"
if systemctl status "wg-quick-${wg_conf}.service" > /dev/null 2>&1; then
sudo -A systemctl stop "wg-quick-${wg_conf}.service" &&
note "connection was dropped"
else
sudo -A systemctl start "wg-quick-${wg_conf}.service" &&
note "traffic routed through $wg_conf"
fi &&
command -v wip > /dev/null && wip
|