2023-05-23 18:15:05 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-06-06 17:35:27 +02:00
|
|
|
set -x
|
|
|
|
|
|
|
|
LOG_FILE=/var/log/netbird/client_pre_install.log
|
|
|
|
AGENT=/usr/local/bin/netbird
|
2023-05-25 12:22:13 +02:00
|
|
|
|
2023-05-31 20:37:21 +02:00
|
|
|
mkdir -p /var/log/netbird/
|
2023-05-31 19:31:37 +02:00
|
|
|
|
2023-05-26 13:07:14 +02:00
|
|
|
{
|
2023-10-30 10:32:48 +01: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
|
2023-06-06 17:35:27 +02:00
|
|
|
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
|
2023-06-06 17:35:27 +02:00
|
|
|
|