Skip to main content

I need an extension attribute to show me if version 4.1.2 of Mcafee Native Encryption is installed. I created this script, but when it is run in the JSS even if 4.1.2 is installed, it still shows the result of Not Latest

!/bin/sh

McAfeeMNEversion='/usr/local/mcafee/mne/bin/MNEMacTool -v'

if [[ $McAfeeMNEversion == "McAfee Management for Native Encryption Version: 4.1.2" ]]; then echo "<result>4.1.2</result>"
else echo "<result>Not Latest</result>"
fi

I don't have that tool on a machine to test, but if you're able to grab the version with a simple one-liner why not just have it display the version rather than an if/else, then have it display as an integer for the EA. You can then create smart groups that look for less than that version.


Here is my EA to report the version of MNE installed:

#!/bin/sh

result=`cat /etc/cma.d/MNEOSX__4000/config.xml | egrep "<Version>.*</Version>" | sed -e "s/<Version>(.*)</Version>/1/"|tr "|" " "`

echo "<result>${result}</result>"

This should work for you !

#!/bin/sh McAfeeMNEversion=$(/usr/local/mcafee/mne/bin/MNEMacTool -v) if [[ $McAfeeMNEversion == "McAfee Management for Native Encryption Version: 4.1.2" ]]; then echo "<result>4.1.2</result>" else echo "<result>Not Latest</result>" fi