netbird/release_files/darwin_pkg/postinstall
2023-05-25 14:40:32 +02:00

33 lines
700 B
Bash
Executable File

#!/bin/sh
APP=/Applications/NetBird.app
AGENT=/usr/local/bin/netbird
LOG_FILE=/var/log/netbird/client_install.log
{
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
ln -s $APP/netbird $AGENT
if test -f $AGENT; then
echo "NetBird binary linked successfully."
else
echo "NetBird could not create symlink to /usr/local/bin"
exit 1
fi
$AGENT service install
$AGENT service start
open $APP
echo "Finished Netbird installation successfully"
exit 0 # all good
} &>> $LOG_FILE