Skip to main content

Running this extension attribute I am finding that it reports as "Not Present" on systems with multiple drives, and possibly OSX Lion server. Is anyone seeing the same thing?

I've seen this as well. I edited my extension attribute like so:



#!/bin/sh



recoveryHDPresent=/usr/sbin/diskutil list | grep "Recovery HD"



if [ "$recoveryHDPresent" != "" ]; then
echo "<result>Present</result>"
else
echo "<result>Not Present</result>"
fi


Yup - I probably should have noticed that disk0 business too! :)



This works, thanks for your help!


For anyone who comes across this later, I found that the following worked on 10.11.4



#!/bin/sh

recoveryHDPresent='/usr/sbin/diskutil list | grep "Recovery HD"'

if [ "$recoveryHDPresent" != "" ]; then echo "<result>Present</result>"

else echo "<result>Not Present</result>"

fi

@dhanes You might want to edit your script to change the single quotes into backticks, or preferable command parenthesis. I.e, either



recoveryHDPresent=`/usr/sbin/diskutil list | grep "Recovery HD"`


or



recoveryHDPresent=$(/usr/sbin/diskutil list | grep "Recovery HD")


The way its posted right now, its not actually running a command. Its just a single quoted string.