Been working on some of my own Extended Attributes, and thought I might share for anyone else who needs it/feedback.
It's a bit all over the place, but it works.
#!/bin/sh
# Returns the "Product Version" of the installed client, if found
if [ -f /Library/Application Support/TrendMicro/TmccMac/UIMgmt.app/Contents/Info.plist ]; then
VERSION=`defaults read /Library/Application Support/TrendMicro/TmccMac/UIMgmt.app/Contents/Info CFBundleShortVersionString`
else
VERSION="Not Installed"
fi
echo "<result>$VERSION</result>"
#!/bin/sh
# Returns the "Parent Server" of the installed client, if found
# We had multiple servers at one point, so this was useful
if [ -f /Library/Application Support/TrendMicro/common/conf/ServerInfo.plist ]; then
SERVER=`defaults read /Library/Application Support/TrendMicro/common/conf/ServerInfo DisplayName`
else
SERVER="Not Found"
fi
echo "<result>$SERVER</result>"
#!/bin/sh
if [ -f /Library/Application Support/TrendMicro/common/conf/tmccmac.conf.plist ]; then
DATE=`/usr/libexec/PlistBuddy -c "print :ACTIVEUPDATE:LastUpdateDatePatternV" /Library/Application Support/TrendMicro/common/conf/tmccmac.conf.plist`
DATE=`date -r $DATE | awk '{ print $3,$2,$4}'`
else
DATE="Not Found"
fi
echo "<result>$DATE</result>"