Skip to content

Instantly share code, notes, and snippets.

@jps3
Last active December 16, 2020 19:17
Show Gist options
  • Save jps3/0f60d72b1222bf877751f0ab402689b8 to your computer and use it in GitHub Desktop.
Save jps3/0f60d72b1222bf877751f0ab402689b8 to your computer and use it in GitHub Desktop.
Jamf 200 - Section 3 - Lesson 13 - Task 3 - Script
#!/bin/bash
#
# Uses Spotlight to identify whether an Application Jamf Admin.app is installed
# (does not assume in /Applications/Jamf Pro/).
# If detected a Jamf inventory update is kicked off.
#
#
PATH=/usr/bin
count=$(mdfind -count 'kMDItemKind=="Application" && (kMDItemFSName=="Jamf Admin.app" || kMDItemCFBundleIdentifier=="com.jamfsoftware.JamfAdmin"c)' 2>&1)
if [[ $count -gt 0 ]]; then
sudo jamf recon -verbose >&2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment