diff --git a/release_files/darwin-ui-installer.sh b/release_files/darwin-ui-installer.sh index 58cbf8749dd..5179f02d6ed 100644 --- a/release_files/darwin-ui-installer.sh +++ b/release_files/darwin-ui-installer.sh @@ -11,14 +11,6 @@ then wiretrustee service uninstall || true fi -# check if it was installed with brew -brew list --formula | grep netbird -if [ $? -eq 0 ] -then - echo "NetBird has been installed with Brew. Please use Brew to update the package." - exit 1 -fi - # check if netbird is installed NB_BIN=$(which netbird) if [ -z "$NB_BIN" ] diff --git a/release_files/darwin_pkg/preinstall b/release_files/darwin_pkg/preinstall index cdea1465c21..5965e82ebe4 100755 --- a/release_files/darwin_pkg/preinstall +++ b/release_files/darwin_pkg/preinstall @@ -8,6 +8,13 @@ AGENT=/usr/local/bin/netbird mkdir -p /var/log/netbird/ { + # check if it was installed with brew + brew list --formula | grep netbird + if [ $? -eq 0 ] + then + echo "NetBird has been installed with Brew. Please use Brew to update the package." + exit 1 + fi osascript -e 'quit app "Netbird"' || true $AGENT service stop || true