forked from jamf/Jamf-Nation-Extension-Attributes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Deep Freeze - Frozen Status.xml
25 lines (23 loc) · 1.13 KB
/
Deep Freeze - Frozen Status.xml
1
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute> <displayName>Deep Freeze - Frozen Status</displayName> <displayInCategory>System State Management</displayInCategory> <description>This attribute returns the Deep Freeze frozen status of a drive.</description> <dataType>string</dataType> <scriptContentsMac>#!/bin/shtargetDrive="/" #Use "/" for the root devicedfUsername="EditFromTemplate_DeepFreeze_Service_Account_Username"dfPassword="EditFromTemplate_DeepFreeze_Service_Account_Password"if [ -f "/Library/Application Support/Faronics/Deep Freeze/CLI" ]; thendiskIdentifier=`df | grep "^$targetDrive" | grep "$targetDrive$" | awk '{print $1}' | sed s:/dev/::g`targetPartition=`diskutil info -plist $diskIdentifier | grep -A 1 VolumeName | grep string | sed s:"<string>"::g | sed s:"</string>"::g | awk '{sub(/^[ \t]+/, ""); print}'`result=`/Library/Application\ Support/Faronics/Deep\ Freeze/CLI "$dfUsername" "$dfPassword" status | grep "$targetPartition" | grep "TRUE"`if [ "$result" == "" ]; then result="False"else result="True"fi fiecho "<result>$result</result>" </scriptContentsMac></extensionAttribute>