-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathReportSIPStatus.sh
More file actions
executable file
·51 lines (42 loc) · 1.29 KB
/
ReportSIPStatus.sh
File metadata and controls
executable file
·51 lines (42 loc) · 1.29 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
#!/bin/sh
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Written by: William Smith
# Professional Services Engineer
# Jamf
# bill@talkingmoose.net
# https://github.com/talkingmoose/Jamf-Scripts
#
# Originally posted: November 20, 2016
# Last updated: August 13, 2018
#
# Purpose: Shell script for Jamf Pro Extension Attribute to report SIP status
# as Enabled, Disabled or Not Supported.
#
# Except where otherwise noted, this work is licensed under
# http://creativecommons.org/licenses/by/4.0/
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Instructions:
# In the Jamf Pro server, create a new Extension Attribute:
# Display Name: SIP Status
# Description: Report whether System Integrity Protection is Enabled or Disabled.
# Data Type: String
# Inventory Display: Operating System
# Input Type: Script
# Script: Contents of this script
#!/bin/sh
# run command to report SIP status
status=$( /usr/bin/csrutil status 2>/dev/null )
case "$status" in
# SIP is enabled
"System Integrity Protection status: enabled.")
echo "<result>Enabled</result>";;
# SIP is disabled
"System Integrity Protection status: disabled.")
echo "<result>Disabled</result>";;
# SIP is not supported
"")
echo "<result>Not Supported</result>";;
esac
exit 0