From 18194e226338a9d296071bd0b0c03f7d7d0baea9 Mon Sep 17 00:00:00 2001 From: tomit4 Date: Mon, 18 Aug 2025 18:15:13 -0700 Subject: [PATCH] :memo: Made notes and adjustments for wireguard setup --- scripts/rt | 21 +++++++++++++++++---- updates.txt | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/scripts/rt b/scripts/rt index 0950c648..6f323b97 100755 --- a/scripts/rt +++ b/scripts/rt @@ -1,13 +1,26 @@ #!/usr/bin/env bash +# OpenVPN Setup +# main() { +# if pgrep -x "openvpn" >/dev/null; then +# IPV4=$(ip addr show dev tun0 | grep inet | awk '{print $2}' | cut -d/ -f1 | head -n 1) +# $(which rtorrent) -b "$IPV4" +# else +# echo "openvpn is not running. please start your VPN first." +# exit 1 +# fi +# } + +# Wireguard Setup +IFACE=$(wg show interfaces | awk '{print $1}') main() { - if pgrep -x "openvpn" >/dev/null; then - IPV4=$(ip addr show dev tun0 | grep inet | awk '{print $2}' | cut -d/ -f1 | head -n 1) + if ip link show "$IFACE" up >/dev/null 2>&1; then + IPV4=$(ip -4 addr show dev "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1) $(which rtorrent) -b "$IPV4" else - echo "openvpn is not running. please start your VPN first." + echo "wireguard interface $IFACE is not up. please start your VPN first." exit 1 fi } -main \ No newline at end of file +main diff --git a/updates.txt b/updates.txt index 00c43709..7b1c1e54 100755 --- a/updates.txt +++ b/updates.txt @@ -889,3 +889,20 @@ cd /etc/runit/sv/unbound && doas touch down 08/07/2025 Uninstall unrar and install rar: doas pacman -Rs unrar && paru -S rar + +08/18/2025 +Enable Wireguard for Mullvad +Mullvad is slowly phasing out OpenVPN, and is encouraging use of Wireguard instead. Firstly install wireguard-tools: +doas pacman -S wireguard-tools wireguard-runit +doas ln -S /etc/runit/sv/wireguard /run/runit/service/ +-Go to Mullvad's Website, login, and Generate a wireguard config with the location of your choosing. +-Once the config is downloaded, edit the file by commenting out the DNS field. +Login as root: +su +And navigate to /etc/wireguard/ +There move the config file from Downloads into /etc/wireguard +mv /home/$USER/Downloads/us-ch-001.conf /etc/wireguard/ +Start wireguard: +doas sv start wireguard +Test it out by going to mullvad's website. +