We collect an extension attribute to display browser versions for Firefox, Chrome and Safari. I'd like to create a Self Service policy so users can determine their browser versions in a single pop-up window (either jamfhelper or Cocoa Dialog). Anybody have something like this they'd like to share?
Solved
Browser Version in Self Service Policy
Best answer by mm2270
Something like this?
#!/bin/bash
appList="/Applications/Safari.app
/Applications/Firefox.app
/Applications/Google Chrome.app"
while read browser; do
appVers=$(defaults read "${browser}/Contents/Info" CFBundleShortVersionString 2>/dev/null)
if [[ ! -z "${appVers}" ]]; then
versList+=($(echo "$(basename "$browser" .app): ${appVers}
"))
fi
done < <(echo "${appList[@]}")
/path/to/cocoaDialog.app/Contents/MacOS/cocoaDialog msgbox
--title "" --text "Your browser versions are:"
--informative-text "$(echo -e "${versList[@]}" | sed 's/^ *//g')" --button1 "OK" --quiet
--Edited slightly to pipe errors to /dev/null and also added --quiet flag to suppress that the OK button was clicked.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
