aboutsummaryrefslogtreecommitdiffstats
path: root/home/root/arrakis.nix
diff options
context:
space:
mode:
authorMark Nipper <nipsy@bitgnome.net>2024-10-15 11:21:12 -0700
committerMark Nipper <nipsy@bitgnome.net>2024-10-15 11:21:12 -0700
commita6b37147a883ce45a409921b0cc86087d85f2145 (patch)
tree2c6dd19dc0653e35e13d211da0b9ce8519254987 /home/root/arrakis.nix
parentc12d847ebfeaf5260cc9dfeba40dece9fdca1768 (diff)
downloadnix-a6b37147a883ce45a409921b0cc86087d85f2145.tar
nix-a6b37147a883ce45a409921b0cc86087d85f2145.tar.gz
nix-a6b37147a883ce45a409921b0cc86087d85f2145.tar.bz2
nix-a6b37147a883ce45a409921b0cc86087d85f2145.tar.lz
nix-a6b37147a883ce45a409921b0cc86087d85f2145.tar.xz
nix-a6b37147a883ce45a409921b0cc86087d85f2145.tar.zst
nix-a6b37147a883ce45a409921b0cc86087d85f2145.zip
Fix VPN script
Diffstat (limited to '')
-rw-r--r--home/root/arrakis.nix10
1 files changed, 6 insertions, 4 deletions
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