|
#!/bin/sh
|
|
|
|
# Install.sh
|
|
# pEpMacOSAdapter
|
|
#
|
|
# Created by David Alarcon on 12/4/21.
|
|
# Copyright © 2021 p≡p foundation. All rights reserved.
|
|
|
|
buildProductsDir=$1
|
|
projectName=$2
|
|
uid=$3
|
|
plist=foundation.pEp.adapter.macOS.plist
|
|
|
|
# Copy the service plist to LaunchAgents
|
|
cp $projectName/$plist /Library/LaunchAgents
|
|
|
|
# Unload the service
|
|
launchctl asuser $uid launchctl unload /Library/LaunchAgents/$plist
|
|
|
|
# Copy the service executable
|
|
cp -f "$buildProductsDir/foundation.pEp.adapter.macOS.xpc/Contents/MacOS/foundation.pEp.adapter.macOS" "/Library/Application Support/pEp/pEp.app/Contents/MacOS"
|
|
|
|
# Load the service
|
|
launchctl asuser $uid launchctl load /Library/LaunchAgents/$plist
|
|
|