From ac0e40da7eef43b99ae379e47b1ca5cbffce690a Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Tue, 23 May 2023 18:15:05 +0200 Subject: [PATCH] add scripts for pkg creation for mac --- release_files/darwin_pkg/postinstall | 31 +++++++++++++++++++++ release_files/darwin_pkg/preinstall | 6 ++++ release_files/darwin_pkg/requirements.plist | 11 ++++++++ 3 files changed, 48 insertions(+) create mode 100755 release_files/darwin_pkg/postinstall create mode 100755 release_files/darwin_pkg/preinstall create mode 100644 release_files/darwin_pkg/requirements.plist diff --git a/release_files/darwin_pkg/postinstall b/release_files/darwin_pkg/postinstall new file mode 100755 index 000000000..b87ef490e --- /dev/null +++ b/release_files/darwin_pkg/postinstall @@ -0,0 +1,31 @@ +#!/bin/sh + +APP=/Applications/NetBird.app +AGENT=/usr/local/bin/netbird + +{ + 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 +} > /tmp/my_postinstall.log diff --git a/release_files/darwin_pkg/preinstall b/release_files/darwin_pkg/preinstall new file mode 100755 index 000000000..6e9c1d9f0 --- /dev/null +++ b/release_files/darwin_pkg/preinstall @@ -0,0 +1,6 @@ +#!/bin/sh + +{ + echo "Preinstall complete" + exit 0 # all good +} > /tmp/my_preinstall.log diff --git a/release_files/darwin_pkg/requirements.plist b/release_files/darwin_pkg/requirements.plist new file mode 100644 index 000000000..dd904f049 --- /dev/null +++ b/release_files/darwin_pkg/requirements.plist @@ -0,0 +1,11 @@ + + + + + arch + + x86_64 + arm64 + + +