-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathEA-Nudge-Deferrals.xml
26 lines (26 loc) · 1.04 KB
/
EA-Nudge-Deferrals.xml
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
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute>
<displayName>Nudge Deferrals</displayName>
<description>A script to determine the number of Nudge deferrals.</description>
<dataType>number</dataType>
<scriptContentsMac>#!/bin/sh
########################################################
# A script to determine the number of Nudge deferrals. #
########################################################
osProductVersion=$( /usr/bin/sw_vers -productVersion )
case "${osProductVersion}" in
10* )
echo "<result>N/A; macOS ${osProductVersion}</result>"
;;
11* | 12* | 13* )
loggedInUser=$( /bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }' )
deferrals=$( /usr/bin/defaults read /Users/"${loggedInUser}"/Library/Preferences/com.github.macadmins.Nudge.plist userDeferrals )
echo "<result>${deferrals}</result>"
;;
esac
exit 0</scriptContentsMac>
</extensionAttribute>