mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-26 16:49:10 +01:00
Merge pull request #937 from netbirdio/fix/kill_process_on_pkg_upgrade
Stop macOS app and service on update with pkg and brew
This commit is contained in:
commit
7d1b6ea1fc
@ -27,6 +27,13 @@ then
|
||||
echo "Please run: brew install netbirdio/tap/netbird"
|
||||
echo "to update it"
|
||||
fi
|
||||
|
||||
if [ -n "$NB_BIN" ]
|
||||
then
|
||||
echo "Stopping NetBird daemon"
|
||||
netbird service stop || true
|
||||
fi
|
||||
|
||||
# start netbird daemon service
|
||||
echo "Starting Netbird daemon"
|
||||
netbird service install || true
|
||||
|
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -x
|
||||
|
||||
APP=/Applications/NetBird.app
|
||||
AGENT=/usr/local/bin/netbird
|
||||
LOG_FILE=/var/log/netbird/client_install.log
|
||||
LOG_FILE=/var/log/netbird/client_post_install.log
|
||||
|
||||
mkdir -p /var/log/netbird/
|
||||
mkdir -p /usr/local/bin/
|
||||
@ -17,7 +19,7 @@ mkdir -p /usr/local/bin/
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ln -s $APP/Contents/MacOS/netbird $AGENT
|
||||
ln -fs $APP/Contents/MacOS/netbird $AGENT
|
||||
if test -f $AGENT; then
|
||||
echo "NetBird binary linked successfully."
|
||||
else
|
||||
@ -25,11 +27,12 @@ mkdir -p /usr/local/bin/
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$AGENT service install
|
||||
$AGENT service start
|
||||
$AGENT service install || true
|
||||
$AGENT service start || true
|
||||
|
||||
open $APP
|
||||
|
||||
echo "Finished Netbird installation successfully"
|
||||
exit 0 # all good
|
||||
} &> $LOG_FILE
|
||||
|
||||
|
@ -1,10 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
LOG_FILE=/var/log/netbird/client_install.log
|
||||
set -x
|
||||
|
||||
LOG_FILE=/var/log/netbird/client_pre_install.log
|
||||
AGENT=/usr/local/bin/netbird
|
||||
|
||||
mkdir -p /var/log/netbird/
|
||||
|
||||
{
|
||||
osascript -e 'quit app "Netbird"' || true
|
||||
$AGENT service stop || true
|
||||
|
||||
echo "Preinstall complete"
|
||||
exit 0 # all good
|
||||
} &> $LOG_FILE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user