From d5d092cbeb423b39bcd81c1b4570af9f4a5df5ef Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Fri, 16 Feb 2024 12:13:20 +0300 Subject: [PATCH] guix: vpn script --- Guix.org | 6 +++++- bin/scripts/vpn-fix-routes | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Guix.org b/Guix.org index 0ec9a4b..7267c6d 100644 --- a/Guix.org +++ b/Guix.org @@ -631,7 +631,11 @@ I'm using Mullvad VPN. The =~/.vpn= folder stores its OpenVPN config (=openvpn.o #+begin_src sh :tangle ~/bin/scripts/vpn-fix-routes echo "Adding default route to $route_vpn_gateway with /0 mask..." - IP=/run/current-system/profile/sbin/ip + if [ -f "/run/current-system/profile/sbin/ip" ]; then + IP=/run/current-system/profile/sbin/ip + else + IP=/usr/bin/ip + fi $IP route add default via $route_vpn_gateway diff --git a/bin/scripts/vpn-fix-routes b/bin/scripts/vpn-fix-routes index 786cada..63f9abe 100755 --- a/bin/scripts/vpn-fix-routes +++ b/bin/scripts/vpn-fix-routes @@ -2,7 +2,11 @@ # [[file:../../Guix.org::*OpenVPN][OpenVPN:9]] echo "Adding default route to $route_vpn_gateway with /0 mask..." -IP=/run/current-system/profile/sbin/ip +if [ -f "/run/current-system/profile/sbin/ip" ]; then + IP=/run/current-system/profile/sbin/ip +else + IP=/usr/bin/ip +fi $IP route add default via $route_vpn_gateway