Bradford Persistent Agent Version Extension Attribute

ctangora
Contributor III

Just spent some time trying to figure this out and thought I would add it to the general KB for y'all. If you are using the Bradford Persistent Agent and noticed that their packaging doesn't always match their actual version, here's the script to the get the actual version number, directly from the Menu Bar Item of the app.

#!/bin/sh

# By Chris Tangora
# Reads the Bradford Persistent Agent's menubar item's file to find the proper version number.

if [[ -e /Library/Application Support/Bradford Networks/Persistent Agent/CSA.app/Contents/Resources/bncsaui.xrs ]]; then
    BPAv=$( zipgrep Version /Library/Application Support/Bradford Networks/Persistent Agent/CSA.app/Contents/Resources/bncsaui.xrs | sed -e 's|.*Version: ||' -e 's|<br.*||' )
    echo "<result>$BPAv</result>"
else
    echo "<result>Not Installed</result>"
fi
exit 0

Hope this can help someone else as well.

4 REPLIES 4

CasperSally
Valued Contributor II

@ctangora - thanks for the extension attribute !

shakim
New Contributor III

Glad to hear others are using this too... Thanks ctangora.

clrlmiller
New Contributor III

Much obliged to you kind sir!!!

Many compliments on your profile pic of Allan from "The Hangover". That, is, rockin' and I owe you a Beer at the next Jamf National Conference!

clrlmiller
New Contributor III

We're moving onto a newer version which has changed code in the Bradford Agent. I've updated the Ext Attribute. See Below...

!/bin/sh

#####################

Original Code By Chris Tangora

Updated by Christopher Miller

of ITSD-ISS for JHU-APL

Dated: 20151001

#####################

Look for the newer app version info

if [[ -e "/Library/Application Support/Bradford Networks/Persistent Agent/CSA.app/Contents/Info.plist" ]]; then BPAv=$(/usr/bin/defaults read "/Library/Application Support/Bradford Networks/Persistent Agent/CSA.app/Contents/Info.plist" | grep CFBundleGetInfoString | awk {'print $3'} | sed -e 's/[";]//g')

Look for the older app version info

elif [[ -e "/Library/Application Support/Bradford Networks/Persistent Agent/CSA.app/Contents/Resources/bncsaui.xrs" ]]; then BPAv=$( zipgrep Version /Library/Application Support/Bradford Networks/Persistent Agent/CSA.app/Contents/Resources/bncsaui.xrs | sed -e 's|.Version: ||' -e 's|<br.||' )

If neither file found, 'taint installed

else BPAv="Not Installed"
fi

Spit out the result

echo "<result>$BPAv</result>"

exit 0