--- rp.orig	2026-08-03 12:38:47 UTC
+++ rp
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!%%BASH%%
 
 set -e
 
@@ -78,7 +78,7 @@ frag_init() {
   explain=0
   frag_transaction=()
   frag "
-    #! /bin/bash
+    #!%%BASH%%
     set -e"
 }
 
@@ -223,14 +223,14 @@ exchange() {
         ip link set dev $(enquote "${dev}") up"
       ;;
 
-    freebsd*)
+    freebsd*|FreeBSD*)
       frag "
         # load the WireGuard kernel module
-        kldload -n if_wg || fatal 'Cannot load if_wg kernel module'"
+        kldload -n if_wg || dbg 'WARNING: Cannot load if_wg kernel module, trying to proceed anyway'"
 
       frag "
         # Create the WireGuard interface
-        ifconfig wg create name $(enquote "${dev}") || true"
+        ifconfig wg create name $(enquote "${dev}") || fatal 'Cannot create wg interface'"
 
       cleanup "
         ifconfig $(enquote "${dev}") destroy || true"
@@ -351,10 +351,6 @@ main() {
   project_name="rosenpass"
   verbose=0
   scriptdir="$(dirname "${script}")"
-  gitdir="$(detect_git_dir)" || true
-  if [[ -d /nix ]]; then
-    nixdir="$(readlink -f result/bin/rp | grep -Pio '^/nix/store/[^/]+(?=/bin/[^/]+)')" || true
-  fi
   binary="$(find_rosenpass_binary)"
 
   # Parse command
