DeepFreeze Status/State Extension Attribute

ahambidge
New Contributor II

Hey guys,

I couldn't manage to get the pre-existing extension attribute for DeepFreeze to work in my environment (perhaps my tech base isn't installing it correctly), but here's a quick extension attribute I wrote to get the status of DeepFreeze if it's installed:

#!/bin/bash

DFStatus=$(DFXPSWD="password" /Library/Application Support/Faronics/Deep Freeze/deepfreeze -u "user" -p status | grep "Frozen" | awk '{ print $3 }' | awk -F: '{ print $2 }')

if [ ! -f /Library/Application Support/Faronics/Deep Freeze/deepfreeze ]; then
    echo "<result>DeepFreeze not installed.</result>"
    elif [ "$DFStatus" == "TRUE" ] ; then
            echo "<result>Frozen</result>"
    else
            echo "<result>Thawed</result>"
    fi
fi
exit

This has been tested against DeepFreeze Enterprise Mac 5.70.2200.0758.

3 REPLIES 3

muribe
New Contributor II

I also had trouble with the pre-existing extension attribute but yours worked perfectly. Let me be the first to thank you!

chris_reynolds1
New Contributor II
New Contributor II

Works Perfectly!! Thanks :)

kboissonneault
New Contributor

I figured it out!!!

Made a new script:

#!/bin/bash

# Queries Deep Freeze status and returns either Frozen, Thawed, or Deep Freeze Not Installed
# Replace password and user below with your Deep Freeze user and password

DFStatus=$(DFXPSWD=password /Library/Application Support/Faronics/Deep Freeze/deepfreeze -u user -p status -x | grep -A1 "<key>bootHow</key>"| awk '{gsub("<key>bootHow</key>", "");print}'| awk '{gsub("<integer>", "");print}' | awk '{gsub("</integer>", "");print}')

if [ ! -f /Library/Application Support/Faronics/Deep Freeze/deepfreeze ]; then
    echo "<result>DeepFreeze not installed.</result>"
fi

if [ "$DFStatus" -eq "0" ]; then
            echo "<result>Frozen</result>"
fi

if [ "$DFStatus" -eq "1" ] || [ "$DFStatus" -eq "2" ] ; then
            echo "<result>Thawed</result>"
fi

exit
Hi, we just got JAMF at our University, but when I tried the existing template and this one, neither works. Your script gives a syntax error on line 12. If I change "elif" to "else if", it will run, however, all machines report as "Frozen", even if they are in fact "Thawed". I tried to make my own script, but my UNIX-fu isn't strong enough. I did manage to figure out that if you issue deepfreeze status -x (with the rest of the above syntax), you'll get an XML output. In there, there is a field like this: <key>bootHow</key> And the next line will be <integer>x</integer> where x is 0, 1, or 2. These appear to be the corresponding options for the radio buttons in the DFXControl App, with 0 being Boot Frozen, 1 is Boot Thawed x Times, 2 Boot Thawed. So I figured I could do something where I grep out the key above and the line afterwards, and then edit out the integer value with awk or sed or whatever, and use that to pass TRUE or FALSE (or FROZEN or THAWED) to JSS. Unfortunately, that's where I'm stuck. I just never really understood how to use awk/sed/etc.