mirror of
https://github.com/jamf/Setup-Manager.git
synced 2026-02-03 14:13:24 +00:00
If JSM fails to complete, it will continue to launch and the uninstall script fails #29
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mattdjerome on GitHub.
If JSM fails to complete and place the /private/var/db/.JamfSetupEnrollmentDone file. it continues to launch until the process completes. THe problem with the uninstall script, is it shows a failure if the remove /private/var/db/.JamfSetupEnrollmentDone is uncommented.
Here's a version of the uninstall script with logic to detect the setup complete file.
`#!/bin/sh
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
appName="Setup Manager"
bundleID="com.jamf.setupmanager"
setupComplete="/private/var/db/.JamfSetupEnrollmentDone"
appPath="/Applications/Utilities/${appName}.app"
if [ "$(whoami)" != "root" ]; then
echo "needs to run as root!"
exit 1
fi
if launchctl list | grep -q "$bundleID" ; then
echo "unloading launch daemon"
launchctl unload /Library/LaunchDaemons/"$bundleID".plist
fi
if [ -e "$appPath" ]; then
rm $appPath
echo "removing files"
rm -rfv "$appPath"
rm -v /Library/LaunchDaemons/"$bundleID".plist
rm -v /Library/LaunchAgents/"$bundleID".loginwindow.plist
fi
echo "forgetting $bundleID pkg receipt"
pkgutil --forget "$bundleID"
if [ -e $setupComplete ]; then
rm -v /private/var/db/.JamfSetupEnrollmentDone
fi
`
@scriptingosx commented on GitHub:
uninstall sample script was updated in 1.4beta