Help with detection script Bomgar Plist

KyleEricson
Valued Contributor II

version_line=$(/usr/libexec/PlistBuddy -c "Print:Bomgar-Version" "/Library/Documentation/B-Info.plist" 2>/dev/null)

if [ $? != 0 ]; then echo "none"
else echo $version_line
fi

exit 0

I have this but my issue is the .app file has a diffrent name for each mac.
Its the Bomgar.app but the name has a ID tied into it example bomgar-scc-1234567-123456.app
How can I use the above code to look at the plist file inside the contents of this .app file.
example code

version_line=$(/usr/libexec/PlistBuddy -c "Print:CFBundleGetInfoString" "/Users/Shared/bomgar-scc-1234567-123456.app/Contents/Info.plist" 2>/dev/null)

if [ $? != 0 ]; then echo "none"
else echo $version_line
fi

exit 0

Read My Blog: https://www.ericsontech.com
1 REPLY 1

daniel_behan
Contributor III

I'm currently using the Extension Attribute below to determine the version of the Jump Client.

!/bin/sh

bomgarpresent=$( /bin/ls -d /Users/Shared/bomgar* | /usr/bin/awk -F "Contents" '{ print $1 }' | /usr/bin/cut -d ':' -f1 )
result=$( /usr/bin/defaults read $bomgarpresent/Contents/Info CFBundleGetInfoString | /usr/bin/cut -d ' ' -f1 )
/bin/echo "<result>$result</result>"