From 077da0dad0ffc8c81fa79fc9c21b326f1724cc6c Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Fri, 19 Apr 2024 12:00:37 +0300 Subject: [PATCH] swapping to handling wg-quick instead of nordvpn --- common/vpn | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) 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