Files
.dotfiles/common/zsh/.config/zsh/config/netbird.zsh
T
tri 34e978e84c refactor: group stow packages into common, mac and kde
Split the packages by platform so each app stays an opt-in Stow package
under common/, mac/ or kde/. KDE gets its own Fastfetch, Helium and
Spectacle packages, and darwin-breeze becomes kde/theme. The READMEs
document stowing a whole group as well as individual packages.
2026-10-30 21:57:15 +07:00

32 lines
1.1 KiB
Bash

#!/usr/bin/env zsh
# NetBird is installed from the official signed .pkg, not Homebrew: the brew
# cask removed the launchd plist in uninstall_preflight and then ran the app's
# installer.sh against the missing service, leaving the daemon crash-looping.
# The pkg's preinstall aborts if the brew formula is present, so keep it out.
nbup() {
local pkg tmp
tmp="$(mktemp -d)" || return 1
pkg="$tmp/netbird.pkg"
print "netbird: downloading arm64 pkg"
curl -fL --progress-bar -o "$pkg" "https://pkgs.netbird.io/macos/arm64" || { rm -rf "${tmp:?}"; return 1; }
if ! pkgutil --check-signature "$pkg" | grep -q "NetBird GmbH"; then
print -u2 "netbird: unexpected pkg signature, refusing to install"
rm -rf "${tmp:?}"
return 1
fi
sudo installer -pkg "$pkg" -target / || { rm -rf "${tmp:?}"; return 1; }
rm -rf "${tmp:?}"
local i
for i in {1..30}; do
[[ -S /var/run/netbird.sock ]] && break
sleep 1
done
/usr/local/bin/netbird status 2>/dev/null |
grep -E '^(Daemon version|CLI version|Management|Signal|NetBird IP):'
}