From a6b37147a883ce45a409921b0cc86087d85f2145 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Tue, 15 Oct 2024 11:21:12 -0700 Subject: Fix VPN script --- home/root/arrakis.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'home') diff --git a/home/root/arrakis.nix b/home/root/arrakis.nix index dcb5347..b852ce5 100644 --- a/home/root/arrakis.nix +++ b/home/root/arrakis.nix @@ -8,7 +8,7 @@ "bin/vpnctl" = { executable = true; text = '' - #!/usr/bin/env zsh + #!${pkgs.zsh}/bin/zsh function status_vpn { @@ -37,7 +37,6 @@ function stop_vpn { - #systemctl stop qbittorrent-nox@nipsy.service prowlarr.service ip netns del vpn ip link del veth.host @@ -52,7 +51,6 @@ stop_vpn sleep 2 start_vpn - #systemctl start qbittorrent-nox@nipsy.service prowlarr.service elif [[ "''${1}" == "restart_firewall" ]]; then @@ -60,7 +58,11 @@ elif [[ "''${1}" == "start" ]]; then - start_vpn + if [[ ! -f /run/netns/vpn ]]; then + start_vpn + else + echo 'VPN service already appears to be running' >&2 + fi elif [[ "''${1}" == "stop" ]]; then -- cgit v1.2.3