From 28ca601487d86b3df693149e83d22b5dc414fbfd Mon Sep 17 00:00:00 2001 From: Michael <30936296+mtan93@users.noreply.github.com> Date: Fri, 23 Jun 2023 19:34:11 +0100 Subject: [PATCH] Create auto-appupdate.zsh --- Helpers/auto-appupdate.zsh | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Helpers/auto-appupdate.zsh diff --git a/Helpers/auto-appupdate.zsh b/Helpers/auto-appupdate.zsh new file mode 100644 index 0000000..3e613d2 --- /dev/null +++ b/Helpers/auto-appupdate.zsh @@ -0,0 +1,45 @@ +#!/bin/zsh +# +# This script will check if Installomator and Patchomator are found locally in their respecitve folders. +# If found, it will execute Patchomator silently (--yes) to install (--install) updates if found. + +# Jamf Pro script parameters +# $4 = ignored labels (space separated) +# $5 = required labels (space separated). + +# This could be adapted to replace triggers at the end of the script by more Jamf Pro script parameters to have more control. + +InstallomatorPath=("/usr/local/Installomator/Installomator.sh") +PatchomatorPath=("/usr/local/Installomator/patchomator.sh") +# +# Check if Installomator is found locally. +# +if [ ! -f $InstallomatorPath ] +then + echo "Installomator is not installed. Exiting." + curl https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/Installomator.sh | bash +fi +echo "Installomator is installed. Continuing." + +# +# Check if Patchomator is found locally. +# +if [ ! -f $PatchomatorPath ] +then + echo "Patchomator is not installed. Exiting." + curl https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/Installomator.sh | bash +fi +echo "Patchomator is installed. Continuing." + +# +# Run Patchomator silently with optional exclusions and requirements. +# This uses Jamf Pro script parameter 4 for ignored labels and parameter 5 for required labels. +# +echo "Running \"patchomator.sh --yes --install --ignored --required\"" +zsh "$PatchomatorPath" --yes --install --ignored "$PIGNOREDAPPS" --required "$PREQUIREDAPPS" +echo "Patchomator script has finished. Exiting." +exit 0 + +# +# End of file. +#