Created
June 5, 2020 19:00
-
-
Save rtrouton/7b6d922a782d6ce4628515ad9dd486a5 to your computer and use it in GitHub Desktop.
jamfComputerBoatEPMInstall_11.5_PreconfiguredSet.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#################################################################################################### | |
# | |
# ABOUT THIS PROGRAM | |
# | |
# NAME | |
# jamfComputerBoatEPMInstall_11.5_PreconfiguredSet -- Install ComputerBoatEPM version 11.5 | |
# | |
# SYNOPSIS | |
# sudo jamfComputerBoatEPMInstall_11.5_PreconfiguredSet <mountPoint> <computerName> <currentUsername> <installZipUrl> <adminUser> <adminPassword> <protectionToken> -- if set is protected | |
# | |
# DESCRIPTION | |
# Sample script to install ComputerBoatEPM version 11.5 with preconfigured set | |
# | |
#################################################################################################### | |
set -x | |
# Provide local admin user to enable macOS secure token | |
ADMIN_USER="" | |
ADMIN_PASSWORD="" | |
# OPTIONAL PARAMETRES STARTS FROM 4 | |
if [ "$COMPUTERBOATEPM_INSTALL_ZIP_URL" == "" ]; then | |
if [ "$4" != "" ]; then | |
COMPUTERBOATEPM_INSTALL_ZIP_URL="$4" | |
fi | |
fi | |
if [ "$ADMIN_USER" == "" ]; then | |
if [ "$5" != "" ]; then | |
ADMIN_USER="$5" | |
fi | |
fi | |
if [ "$ADMIN_PASSWORD" == "" ]; then | |
if [ "$6" != "" ]; then | |
ADMIN_PASSWORD="$6" | |
fi | |
fi | |
PROTECTION_ARG="" | |
protectionToken=$7 | |
if [ "$protectionToken" != "" ]; then | |
PROTECTION_ARG=" -token $protectionToken" | |
fi | |
COMPUTERBOATEPM_INSTALL_ZIP=$(basename $COMPUTERBOATEPM_INSTALL_ZIP_URL) | |
COMPUTERBOATEPM_INSTALL_TMP=$(mktemp -d -t ci-XXXXXXXXXX) | |
echo "======== id output ===========" | |
id -p | |
echo "==============================" | |
rm -fr $COMPUTERBOATEPM_INSTALL_TMP | |
mkdir -p $COMPUTERBOATEPM_INSTALL_TMP | |
curl -sk "$COMPUTERBOATEPM_INSTALL_ZIP_URL" -o "$COMPUTERBOATEPM_INSTALL_TMP/ComputerBoatEPMAgentSetupMacOs.zip" | |
ditto -xk $COMPUTERBOATEPM_INSTALL_TMP/ComputerBoatEPMAgentSetupMacOs.zip $COMPUTERBOATEPM_INSTALL_TMP | |
ditto -xk $COMPUTERBOATEPM_INSTALL_TMP/Install\ ComputerBoat\ EPM.app.zip $COMPUTERBOATEPM_INSTALL_TMP | |
ls -al $COMPUTERBOATEPM_INSTALL_TMP | |
xattr -d $COMPUTERBOATEPM_INSTALL_TMP/Install\ ComputerBoat\ EPM.app | |
echo "Installing..." | |
$COMPUTERBOATEPM_INSTALL_TMP/Install\ ComputerBoat\ EPM.app/Contents/MacOS/ComputerBoatEPMInstaller -adminUser "$ADMIN_USER" -adminPassword "$ADMIN_PASSWORD" $PROTECTION_ARG | |
epmVersionFull=$(/usr/local/bin/ComputerBoatEPM --version) | |
echo "Cleaning up" | |
rm -fr $COMPUTERBOATEPM_INSTALL_TMP | |
if [[ ! $epmVersionFull ]]; then | |
echo "ComputerBoat EPM installation failed" | |
exit 2 | |
fi | |
echo "$epmVersionFull was successfully installed" | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment