This library contains a number of CLI scripts designed to work with Jamf, including Extension Attributes, installers, preference setters, uninstallers, and more.
For convenience, some scripts may dependencies on the following tools:
- JQ (JSON)
- YQ (YAML)
- JSS Easy (JSS Convenience Utility)
- MacPrefer (Docks, Preferences, Adobe Apps)
- DockUtil (Mac Docks)
Any script that has a dependency not contained within macOS by default should indicate that dependency in a comment block at the top of the script. Using scripts contained within this repo, it is fairly easy to set up policies for your systems to download and install these dependencies.
To reduce the time investment in using these scripts, all scripts should follow the following basic structure:
- A comment block indicating purpose, dependencies, source/author.
- Input variables required for the script, each documented.
- Other variables used within the script, each documented.
- Any functions used within the script, each documented.
- The runtime code of the script.
Additionally, scripts with similar functions should be named with the same naming conventions. For instance, two scripts that both install something might be named install-xxxxx.sh.
Most scripts in this repo are bash scripts, however in a few cases where bash was not well suited for the task, PHP has been used. My focus is on getting the job done, not on the language used.
Some of the scripts contained within the repo are "templates" from which to create multiple scripts with similar purposes. These scripts have an uppercase T at the end of their filename to distinguish them from ready-to-use scripts.
The changes needed in these scripts should be self-explanatory and documented with comments.
The scripts that provide information to be used in Jamf Extension Attributes are located in the attributes directory. The output of these scripts is wrapped in a tag for processing by Jamf's recon functionality.
In cases where the script should provide boolean-style information, they should return uppercase strings of TRUE or FALSE, properly wrapped in a tag.
In cases where a system may or may not have a value, such as the version of an installed binary, the scripts should generally return the string None.
The majority of the scripts in this repo are in day-to-day use in a Jamf managed macOS environment. I am happy to take a look at adding requested features, if they seem like they might be useful within that environment. You are also welcome to submit pull requests, and to fork this repo.