From 69752b7cb7da156cc4f4b0acfe4c745c9f1541d8 Mon Sep 17 00:00:00 2001 From: Viktor Liu Date: Tue, 28 Apr 2026 14:49:20 +0200 Subject: [PATCH] Stop and remove NetBird daemon in darwin UI uninstaller --- release_files/darwin-ui-uninstaller.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) mode change 100644 => 100755 release_files/darwin-ui-uninstaller.sh diff --git a/release_files/darwin-ui-uninstaller.sh b/release_files/darwin-ui-uninstaller.sh old mode 100644 new mode 100755 index 45938dfbc..f2110d287 --- a/release_files/darwin-ui-uninstaller.sh +++ b/release_files/darwin-ui-uninstaller.sh @@ -1,14 +1,19 @@ #!/bin/sh -export PATH=$PATH:/usr/local/bin +export PATH=$PATH:/usr/local/bin:/opt/homebrew/bin -# check if netbird is installed -NB_BIN=$(which netbird) -if [ -z "$NB_BIN" ] -then - exit 0 +NB_BIN=$(command -v netbird) +if [ -n "$NB_BIN" ]; then + echo "Stopping NetBird daemon" + "$NB_BIN" service stop 2>/dev/null || true + echo "Uninstalling NetBird daemon" + "$NB_BIN" service uninstall 2>/dev/null || true fi -# start netbird daemon service -echo "netbird daemon service still running. You can uninstall it by running: " -echo "sudo netbird service stop" -echo "sudo netbird service uninstall" + +PLIST=/Library/LaunchDaemons/netbird.plist +if [ -f "$PLIST" ]; then + launchctl bootout system "$PLIST" 2>/dev/null || launchctl unload "$PLIST" 2>/dev/null || true + rm -f "$PLIST" +fi + +exit 0