-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLabStats_uninstaller.jss.sh
More file actions
67 lines (48 loc) · 1.64 KB
/
LabStats_uninstaller.jss.sh
File metadata and controls
67 lines (48 loc) · 1.64 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash --noprofile --norc
# Jason Filice
# jfilice@csumb.edu
# Technology Support Services in IT
# California State University, Monterey Bay
# https://csumb.edu/it
# This script removes components of the LabStats client.
# Run it with no arguments.
# Use as script in Jamf JSS.
# Orignal source:
# https://support.labstats.com/knowledge-base/uninstall-the-labstats-client/
# Change History:
# 2025/09/11: Creation.
#
SCRIPTNAME=$(/usr/bin/basename "$0")
SCRIPTDIR=$(/usr/bin/dirname "$0")
# Jamf JSS Parameters 1 through 3 are predefined as mount point, computer name, and username
pathToScript=$0
mountPoint=$1
computerName=$2
userName=$3
shift 3
# Shift off the $1 $2 $3 parameters passed by the JSS so that parameter 4 is now $1
echo "pathToScript=$pathToScript"
echo "mountPoint=$mountPoint"
echo "computerName=$computerName"
echo "userName=$userName"
if [ -f /Library/LaunchDaemons/labstatsgo.plist ]; then
/bin/launchctl unload /Library/LaunchDaemons/labstatsgo.plist
fi
if [ -f /Library/LaunchAgents/labstatsgo.plist ]; then
/usr/bin/sudo -u daemon launchctl unload /Library/LaunchAgents/labstatsgo.plist
fi
if [ -f /Library/LaunchDaemons/labstatsgo.plist ]; then
/bin/rm -f /Library/LaunchDaemons/labstatsgo.plist
fi
if [ -f /Library/LaunchAgents/labstatsgo.plist ]; then
/bin/rm -f /Library/LaunchAgents/labstatsgo.plist
fi
/usr/bin/pkill LabStatsGoUserSpace
if [ -f /usr/local/bin/LabStatsGoClient ]; then
/bin/rm -f /usr/local/bin/LabStatsGoClient
fi
if [ -f /usr/local/bin/LabStatsGoUserSpace ]; then
/bin/rm -f /usr/local/bin/LabStatsGoUserSpace
fi
/bin/rm -rf /Library/Application\ Support/LabStatsGo
echo "Uninstall successful!"