netbird/release_files/darwin_pkg/preinstall

25 lines
500 B
Plaintext
Raw Permalink Normal View History

2023-05-23 18:15:05 +02:00
#!/bin/sh
set -x
LOG_FILE=/var/log/netbird/client_pre_install.log
AGENT=/usr/local/bin/netbird
2023-05-25 12:22:13 +02:00
mkdir -p /var/log/netbird/
2023-05-26 13:07:14 +02:00
{
# 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
2023-05-26 13:07:14 +02:00
echo "Preinstall complete"
exit 0 # all good
} &> $LOG_FILE