Actifile macOS Deployment Script for MDM

Use the script below to deploy the Actifile agent on macOS machines via your MDM solution.

Edit the Script with Your Install Key

Before running the script, you’ll need to edit it to include your Actifile installation key. Locate the following line:

INSTALL_KEY=$1

Replace $1 with your actual installation key, for example:

INSTALL_KEY=1234-1234-1234-1234

Get the Script

  • Download the script here.
  • Or, just copy it below.
#!/bin/bash
#
# mdm_install.sh
# Actifile
#
# Created by Oleg Kulchytskyi on 3/07/24.
# Copyright © 2024 Actifile. All rights reserved.
#

#
# NOTE: A helper script for MDM console to install actifile remotely
#

INSTALL_KEY=$1
INSTALLER_PATH=/Users/Shared

# Download the ActifileMacAgentInstaller.zip using curl
sudo curl -L -o "$INSTALLER_PATH/ActifileMacAgentInstaller.zip" "https://app.actifile.com/Home/DownloadMacAgent"

# Check if the download was successful before proceeding
if [ $? -ne 0 ]; then
echo "Failed to download ActifileMacAgentInstaller.zip"
exit 1
fi

# Unzip the downloaded file
sudo unzip "$INSTALLER_PATH/ActifileMacAgentInstaller.zip" -d "$INSTALLER_PATH/ActifileMacAgentInstaller"

# Check if the unzip was successful before proceeding
if [ $? -ne 0 ]; then
echo "Failed to unzip ActifileMacAgentInstaller.zip"
exit 1
fi

# # Install the ActifileMacAgentInstaller.app with the specified key
sudo "$INSTALLER_PATH/ActifileMacAgentInstaller/ActifileMacAgentInstaller.app/Contents/MacOS/FileControlInstaller" install --key "$INSTALL_KEY"

# # Check if the installation was successful
if [ $? -ne 0 ]; then
echo "Failed to install ActifileMacAgentInstaller.app"
exit 1
fi

echo "ActifileMacAgentInstaller.app has been installed successfully."

This script is intended for use with an MDM and will install and activate the Actifile agent on macOS endpoints.