This guide applies to Mac computers
What is Homebrew?
Homebrew is a free and open-source package management system for macOS that simplifies software installation. It has become a popular tool among developers and system administrators for its ease of use and extensive package availability.As with all scripts, please test thoroughly before deploying to Mac computers in production.
How Homebrew Works
Homebrew integrates with the command-line interface (CLI) and lets local administrators install required software using the CLI. This tool is useful for developers and system administrators who need to install libraries and tools efficiently.homebrew_audit.zsh checks whether Homebrew is installed. homebrew_install.zsh installs the latest stable Homebrew release. You can deploy either script on its own, or use them together so the install script runs when the audit does not pass.
Prerequisites
- Copy
homebrew_audit.zshfrom the Iru Endpoint support GitHub repository. - Copy
homebrew_install.zshfrom the same repository. - Review the Homebrew scripts README for tested versions of macOS, install methods, audit options, and script behavior.
Add a Custom Script
To add this Library Item to your Iru Endpoint Library, follow the steps outlined in the Library Overview article. For high-level Custom Script options such as naming the Library Item, Blueprint assignment, execution frequency, and Self Service, see Custom Scripts Overview.Configure the audit script
homebrew_audit.zsh reports whether Homebrew is installed and whether its version can be read. Deploy it on its own when you only want to audit Homebrew. To install Homebrew when that audit reports Error, add the install script as the remediation script in the same Library Item.
The PASS_WHEN value determines the expected state of Homebrew. Use "installed" when Homebrew should be present, including when homebrew_install.zsh is the remediation script. Use "not_installed" only for an audit-only Library Item when Homebrew should not be present.
1
Set PASS_WHEN
In
homebrew_audit.zsh, set PASS_WHEN to "installed" when homebrew_install.zsh is the remediation script. For an audit-only Library Item, set PASS_WHEN to "installed" when Homebrew should be present, or "not_installed" when it should not be present.2
Add the audit script
Paste the script into the Audit Script field.
3
Save the configuration
Select Save in the lower right-hand corner. You can save here when this Library Item only audits Homebrew.
Configure the install script
homebrew_install.zsh installs the latest stable Homebrew release. Deploy it on its own when you only want to install Homebrew. To use it with the audit script, add it as the remediation script in that Library Item instead. Iru runs the remediation script when the audit reports Error.
1
Add the install script
To install Homebrew on its own, paste
homebrew_install.zsh into the Audit Script field of its own Custom Script Library Item. To install Homebrew when the audit reports Error, paste it into the Remediation Script field of the audit script’s Library Item instead.2
Save the configuration
Select Save in the lower right-hand corner to complete the Custom Script setup.
Related Articles
Library Overview
Overview of the Iru Endpoint Library for managing apps, profiles, scripts, and configurations. Curate Library Items and assign them to device Blueprints.
Custom Scripts Overview
Deploy custom scripts to managed Mac and Windows computers using Iru Endpoint. Run shell, Python, PowerShell, or batch scripts on enrollment or on schedule.