-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathuninstall.sh
executable file
·45 lines (34 loc) · 1.12 KB
/
uninstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
# uninstall.sh
# removes Setup Manager app and all related files
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Note:
# Setup Manager creates a flag file at
#
# /private/var/db/.JamfSetupEnrollmentDone
#
# when it completes successfully. This uninstall script
# does NOT remove this file. When you re-install Setup
# Manager after running this script, the flag file's
# existence will suppress the launch of Setup Manager.
#
# Depending on your workflow needs, you may want to
# uncomment the last line which removes the flag file.
appName="Setup Manager"
bundleID="com.jamf.setupmanager"
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
echo "removing files"
rm -rfv "$appPath"
rm -v /Library/LaunchDaemons/"$bundleID".plist
rm -v /Library/LaunchAgents/"$bundleID".loginwindow.plist
echo "forgetting $bundleID pkg receipt"
pkgutil --forget "$bundleID"
# rm -v /private/var/db/.JamfSetupEnrollmentDone