diff --git a/common/vpn b/common/vpn index 8861a0d..ea84f38 100755 --- a/common/vpn +++ b/common/vpn @@ -1,12 +1,14 @@ #!/bin/sh -if [ "$1" == "on" ]; then - cmd="c P2P" -elif [ "$1" == "off" ]; then - cmd="d" -elif [ "$1" == "status" ]; then - cmd="status" -else - echo "Please pass an argument: on, off, status" - exit +if [ ! -n "$VPN_NODE" ]; then + echo "Please set VPN_NODE" + exit 2 fi -nordvpn $cmd +if [ "$1" == "up" ]; then + cmd="up $VPN_NODE" +elif [ "$1" == "down" ]; then + cmd="down $VPN_NODE" +else + echo "Please pass an argument: up, down" + exit 1 +fi +doas wg-quick $cmd