Coro recommends using the following shell script to deploy the Coro Agent on macOS endpoint devices. Run the script on individual devices for standalone deployment or use a remote monitoring and management (RMM) platform to deploy it to multiple devices.
Most RMM platforms require specific parameters to be set when using bash scripts for deployment. This script was tested specifically with Microsoft Intune. If you encounter issues when deploying this script through platforms other than Intune, Coro recommends contacting the support service for that platform to obtain any specific parameters that might need to be set for the script to run.
The script exits without downloading the installer if the Coro Agent is already installed on the device - do not remove this check. The Coro Agent performs self-updates after installation, so the script only needs to install it once. Without this check, every run of the script downloads the full installer again, which can have a performance impact if your RMM platform runs the script on a regular schedule.
#!/bin/bash
if [ -d "/Applications/Coro Endpoint Protection.app" ]; then
echo "Coro Agent is already installed. Nothing to do."
exit 0
fi
curl "<CORO PACKAGE DOWNLOAD URL>" --output $COMPUTER/$VOLUME/Users/Shared/<Installerfilename>.pkg
Sudo -S installer -allowUntrusted -verboseR -pkg $COMPUTER/$VOLUME/Users/Shared/<Installerfilename>.pkg -target /
sleep 45
rm -rf $COMPUTER/$VOLUME/Users/Shared/<Installerfilename>.pkgIn this script, replace the following markers for real values:
- <CORO PACKAGE DOWNLOAD URL>: The download URL for the latest version of the Coro Agent installer for macOS devices, obtained from the Coro console. For details, see Deploying Coro on macOS endpoints.
- <Installerfilename>: The unique installer .pkg filename embedded in the download URL.
You can modify the installer file location used in your script based on your system requirements. Coro uses $COMPUTER/$VOLUME/Users/Shared as this is the default public directory on all macOS devices with modify level permissions for all users, meaning our script has permission to write to that location.
For example, if the download URL is:
https://s3.amazonaws.com/client-repo.coro.net/secure/macos/releases/5.14.15/CoroInstaller.pkg?response-content-disposition=attachment%3B%20filename%3DCoroInstaller_123abc-456def-789abc.pkg&AWSAccessKeyId=AKIAYE4534SG&Signature=xFgQpGjD&Expires=2015740556
The installer filename (shown in bold) is then used within the shell script as per the following example:
#!/bin/bash
if [ -d "/Applications/Coro Endpoint Protection.app" ]; then echo "Coro Agent is already installed. Nothing to do." exit 0 fi
curl "https://s3.amazonaws.com/client-repo.coro.net/secure/macos/releases/5.14.15/CoroInstaller.pkg?response-content-disposition=attachment%3B%20filename%3DCoroInstaller_123abc-456def-789abc.pkg&AWSAccessKeyId=AKIAYE4534SG&Signature=xFgQpGjD&Expires=2015740556" --output $COMPUTER/$VOLUME/Users/Shared/CoroInstaller_123abc-456def-789abc.pkg
Sudo -S installer -allowUntrusted -verboseR -pkg $COMPUTER/$VOLUME/Users/Shared/CoroInstaller_123abc-456def-789abc.pkg -target /
sleep 45
rm -rf $COMPUTER/$VOLUME/Users/Shared/CoroInstaller_123abc-456def-789abc.pkg