2023-05-23 18:15:05 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-06-06 17:35:27 +02:00
|
|
|
set -x
|
|
|
|
|
2023-05-23 18:15:05 +02:00
|
|
|
APP=/Applications/NetBird.app
|
|
|
|
AGENT=/usr/local/bin/netbird
|
2023-06-06 17:35:27 +02:00
|
|
|
LOG_FILE=/var/log/netbird/client_post_install.log
|
2023-05-23 18:15:05 +02:00
|
|
|
|
2023-05-31 20:37:21 +02:00
|
|
|
mkdir -p /var/log/netbird/
|
2023-06-01 16:00:44 +02:00
|
|
|
mkdir -p /usr/local/bin/
|
2023-05-31 19:31:37 +02:00
|
|
|
|
2023-05-26 13:07:14 +02:00
|
|
|
{
|
|
|
|
echo "Installing NetBird..."
|
|
|
|
|
|
|
|
if test -d $APP; then
|
|
|
|
echo "NetBird app copied successfully."
|
|
|
|
else
|
|
|
|
echo "NetBird app could not be copied to the Applications folder."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-06-06 17:35:27 +02:00
|
|
|
ln -fs $APP/Contents/MacOS/netbird $AGENT
|
2023-05-26 13:07:14 +02:00
|
|
|
if test -f $AGENT; then
|
|
|
|
echo "NetBird binary linked successfully."
|
|
|
|
else
|
|
|
|
echo "NetBird could not create symlink to /usr/local/bin"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-06-06 00:04:57 +02:00
|
|
|
$AGENT service install || true
|
|
|
|
$AGENT service start || true
|
2023-05-26 13:07:14 +02:00
|
|
|
|
|
|
|
open $APP
|
|
|
|
|
|
|
|
echo "Finished Netbird installation successfully"
|
|
|
|
exit 0 # all good
|
2023-05-26 13:56:01 +02:00
|
|
|
} &> $LOG_FILE
|
2023-06-06 17:35:27 +02:00
|
|
|
|