mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-28 07:19:08 +01:00
Stop and remove NetBird daemon in darwin UI uninstaller
This commit is contained in:
Regular → Executable
+15
-10
@@ -1,14 +1,19 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
export PATH=$PATH:/usr/local/bin
|
export PATH=$PATH:/usr/local/bin:/opt/homebrew/bin
|
||||||
|
|
||||||
# check if netbird is installed
|
NB_BIN=$(command -v netbird)
|
||||||
NB_BIN=$(which netbird)
|
if [ -n "$NB_BIN" ]; then
|
||||||
if [ -z "$NB_BIN" ]
|
echo "Stopping NetBird daemon"
|
||||||
then
|
"$NB_BIN" service stop 2>/dev/null || true
|
||||||
exit 0
|
echo "Uninstalling NetBird daemon"
|
||||||
|
"$NB_BIN" service uninstall 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
# start netbird daemon service
|
|
||||||
echo "netbird daemon service still running. You can uninstall it by running: "
|
PLIST=/Library/LaunchDaemons/netbird.plist
|
||||||
echo "sudo netbird service stop"
|
if [ -f "$PLIST" ]; then
|
||||||
echo "sudo netbird service uninstall"
|
launchctl bootout system "$PLIST" 2>/dev/null || launchctl unload "$PLIST" 2>/dev/null || true
|
||||||
|
rm -f "$PLIST"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user