Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Last active March 4, 2020 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtrouton/e390486b0cec895b9fb9b19cf87fa10a to your computer and use it in GitHub Desktop.
Save rtrouton/e390486b0cec895b9fb9b19cf87fa10a to your computer and use it in GitHub Desktop.
Preinstall script for Privileges.app installer package
#!/bin/bash
# preinstall.sh
# Marc Thielemann, 2019/09/15
# redirect all output to /dev/null
exec >/dev/null 2>&1
helperPlistPath="$3/Library/LaunchDaemons/corp.sap.privileges.helper.plist"
/usr/bin/killall Privileges
# unload the launchd plist only if installing on the boot volume
if [[ "$3" = "/" ]]; then
/bin/launchctl bootout system "$helperPlistPath"
fi
/bin/rm -rf "$helperPlistPath" \
"$3/Library/PrivilegedHelperTools/corp.sap.privileges.helper" \
"$3/Applications/Privileges.app"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment