Using a shell script to deploy Coro to macOS devices

Coro recommends the following shell script to enable organizations to deploy the Coro Agent to their macOS endpoint devices. You can activate this script on a device individually for a standalone deployment or to a group of devices via a remote monitoring and management (RMM) platform.

Important

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.

Copy
Copied
#!/bin/bash

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>.pkg

In 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.
note

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:

Copy
Copied
#!/bin/bash

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