Skip to content

If JSM fails to complete, it will continue to launch and the uninstall script fails #156

@mattdjerome

Description

@mattdjerome

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
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions