forked from jamf/Jamf-Nation-Extension-Attributes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnergy Saver - Hard Disk Sleep.xml
31 lines (30 loc) · 1.06 KB
/
Energy Saver - Hard Disk Sleep.xml
1
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute> <displayName>Energy Saver - Hard Disk Sleep</displayName> <displayInCategory>Security Reporting</displayInCategory> <dataType>string</dataType> <description>This attribute verifies the "Hard Disk Sleep" energy saver setting. The value to be verified will need to be specified when creating this extension attribute. Example: "false" verifies that the "Hard Disk Sleep" setting is set to not put the hard disk to sleep.</description> <scriptContentsMac>#!/bin/shdesiredValue="EditFromTemplate_Desired_Value_-_Example:_false"result=""tmpResult="`/usr/bin/pmset -g | grep -w disksleep | awk '{print $2}'`"if [ "$tmpResult" == "1" ]; thenresult="true"elseif [ "$tmpResult" == "0" ]; then result="false"else if [ "$tmpResult" == "" ]; then result="Domain or Key Not Found" else result="$tmpResult" fififiif [ "$result" == "$desiredValue" ]; thenecho "<result>Pass ($result)</result>"elseecho "<result>Fail ($result)</result>"fi </scriptContentsMac></extensionAttribute>