MDM scripts updated

This commit is contained in:
Søren Theilgaard
2022-03-30 13:39:23 +02:00
parent 7fa9d3c24a
commit f8a3104470
6 changed files with 167 additions and 102 deletions

View File

@@ -5,8 +5,28 @@ what="brave" # enter the software to install
# To be used as a script sent out from a MDM. # To be used as a script sent out from a MDM.
# Fill the variable "what" above with a label. # Fill the variable "what" above with a label.
# Script will run this label. # Script will run this label.
LOGO="appstore" # or "addigy", "microsoft", "mosyleb", "mosylem"
######################################################################
# Parameters for reinstall/initial install (owner root:wheel):
# "BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force IGNORE_APP_STORE_APPS=yes SYSTEMOWNER=1"
# Parameters for Self Service installed app:
# "BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all"
# Parameters for security important apps, like browsers (run automaticaly every day):
# "BLOCKING_PROCESS_ACTION=tell_user_then_kill"
# Update of service apps (run automatically):
# "BLOCKING_PROCESS_ACTION=quit_kill NOTIFY=silent"
parameters="BLOCKING_PROCESS_ACTION=tell_user_then_kill NOTIFY=all"
############################################### ###############################################
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping # No sleeping
/usr/bin/caffeinate -d -i -m -u & /usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$! caffeinatepid=$!
@@ -16,18 +36,14 @@ caffexit () {
exit $1 exit $1
} }
# Verify that Installomator has been installed cmdOutput="$(${destFile} ${what} LOGO=$LOGO $parameters LOGGING=WARN || true)"
destFile="/usr/local/Installomator/Installomator.sh" # Check result
if [ ! -e "${destFile}" ]; then exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
echo "Installomator not found here:" if [[ ${exitStatus} -ne 0 ]] ; then
echo "${destFile}" echo -e "Error installing ${what}. Exit code ${exitStatus}"
echo "Exiting." #echo "$cmdOutput"
caffexit 99 errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
fi echo "$errorOutput"
${destFile} ${what} LOGO=mosyleb BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=all #INSTALL=force
if [ $? != 0 ]; then
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle!
echo "Error installing ${what}. Exit code $?" echo "Error installing ${what}. Exit code $?"
caffexit $? caffexit $?
fi fi

View File

@@ -1,11 +1,31 @@
#!/bin/zsh #!/bin/zsh
# Installation using Installomator # Installation using Installomator
what="microsoftteams microsoftyammer firefox bravebrowser cyberduck vlc signal" # enter the software to install separated with spaces whatList="microsoftteams microsoftyammer firefox bravebrowser cyberduck vlc signal" # enter the software to install separated with spaces
# To be used as a script sent out from a MDM. # To be used as a script sent out from a MDM.
# Fill the variable "what" above with labels separated by space " ". # Fill the variable "whatList" above with labels separated by space " ".
# Script will loop through these labels. # Script will loop through these labels.
LOGO="appstore" # or "addigy", "microsoft", "mosyleb", "mosylem"
###################################################################### ######################################################################
# Parameters for reinstall/initial install (owner root:wheel):
# "BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force IGNORE_APP_STORE_APPS=yes SYSTEMOWNER=1"
# Parameters for Self Service installed app:
# "BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all"
# Parameters for security important apps, like browsers (run automaticaly every day):
# "BLOCKING_PROCESS_ACTION=tell_user_then_kill"
# Update of service apps (run automatically):
# "BLOCKING_PROCESS_ACTION=quit_kill NOTIFY=silent"
parameters="BLOCKING_PROCESS_ACTION=tell_user NOTIFY=all"
######################################################################
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping # No sleeping
/usr/bin/caffeinate -d -i -m -u & /usr/bin/caffeinate -d -i -m -u &
@@ -19,21 +39,17 @@ caffexit () {
# Count errors # Count errors
errorCount=0 errorCount=0
# Verify that Installomator has been installed for what in $whatList; do
destFile="/usr/local/Installomator/Installomator.sh" #echo $what
if [ ! -e "${destFile}" ]; then # Install software using Installomator
echo "Installomator not found here:" cmdOutput="$(${destFile} ${what} LOGO=$LOGO $parameters LOGGING=WARN || true)"
echo "${destFile}" # Check result
echo "Exiting." exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
caffexit 99 if [[ ${exitStatus} -ne 0 ]] ; then
fi echo -e "Error installing ${what}. Exit code ${exitStatus}"
#echo "$cmdOutput"
for item in $what; do errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo $item echo "$errorOutput"
${destFile} ${item} LOGO=mosyleb BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=all #INSTALL=force
if [ $? != 0 ]; then
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle!
echo "[$(DATE)] Error installing ${item}. Exit code $?"
let errorCount++ let errorCount++
fi fi
done done

View File

@@ -1,9 +1,18 @@
#!/bin/bash #!/bin/bash
# Updating Installomator # Updating Installomator
# Usefull to push out after deployment if earlier version was deployed in DEP profile # Usefull to push out after deployment if earlier version was deployed in DEP profile
# Currently script uses valuesfromarguments as a label is not included before next release, so this can be used to install to version 0.7
what="installomator" # enter the software to install what="installomator" # enter the software to install
LOGO="appstore" # or "addigy", "microsoft", "mosyleb", "mosylem"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping # No sleeping
/usr/bin/caffeinate -d -i -m -u & /usr/bin/caffeinate -d -i -m -u &
@@ -14,30 +23,19 @@ caffexit () {
exit $1 exit $1
} }
# Verify that Installomator has been installed # Install software using Installomator
destFile="/usr/local/Installomator/Installomator.sh" cmdOutput="$(${destFile} ${what} LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent LOGGING=req || true)"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
caffexit 99
fi
${destFile} valuesfromarguments\ # Check result
name=Installomator \ exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
type=pkg \ if [[ ${exitStatus} -eq 0 ]] ; then
packageID=com.scriptingosx.Installomator \ echo -e "${what} succesfully installed.\n"
downloadURL=https://github.com/Installomator/Installomator/releases/download/v0.7release/Installomator-0.7.0.pkg \ else
appNewVersion=0.7 \ echo -e "Error installing ${what}. Exit code ${exitStatus}\n"
expectedTeamID=JME5BW3F3R \ #echo "$cmdOutput"
BLOCKING_PROCESS_ACTION=ignore \ errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
NOTIFY=silent echo "$errorOutput"
caffexit $exitStatus
# ${destFile} ${what} BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent
if [ $? != 0 ]; then
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle!
echo "Error installing ${what}. Exit code $?"
caffexit $?
fi fi
echo "[$(DATE)][LOG-END]" echo "[$(DATE)][LOG-END]"

View File

@@ -5,15 +5,34 @@
# Mark: Installation script # Mark: Installation script
# Just click “Add” to autogenerate the installer script line by clicking the “Add”-button next to the Installer PKG, replace with first line below # Just click “Add” to autogenerate the installer script line by clicking the “Add”-button next to the Installer PKG, replace with first line below
/usr/sbin/installer -pkg "/Library/Addigy/ansible/packages/Installomator (0.7.0)/Installomator-0.7.0.pkg" -target / /usr/sbin/installer -pkg "/Library/Addigy/ansible/packages/Installomator (9.1.0)/Installomator-9.1.pkg" -target /
# Installation using Installomator # Installation using Installomator
what="supportapp xink textmate microsoftedge wwdc keka vlc " # enter the software to installed separated with spaces whatList="supportapp xink textmate microsoftedge wwdc keka vlc " # enter the software to installed separated with spaces
# To be used as a script sent out from a MDM. # To be used as a script sent out from a MDM.
# Fill the variable "what" above with labels separated by space " ". # Fill the variable "whatList" above with labels separated by space " ".
# Script will loop through these labels and exit with number of errors. # Script will loop through these labels and exit with number of errors.
###################################################################### ######################################################################
# Parameters for reinstall/initial install (owner root:wheel):
# "BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force IGNORE_APP_STORE_APPS=yes SYSTEMOWNER=1"
# Parameters for Self Service installed app:
# "BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all"
# Parameters for security important apps, like browsers (run automaticaly every day):
# "BLOCKING_PROCESS_ACTION=tell_user_then_kill"
# Update of service apps (run automatically):
# "BLOCKING_PROCESS_ACTION=quit_kill NOTIFY=silent"
parameters="BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force IGNORE_APP_STORE_APPS=yes"
######################################################################
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping # No sleeping
/usr/bin/caffeinate -d -i -m -u & /usr/bin/caffeinate -d -i -m -u &
@@ -27,21 +46,17 @@ caffexit () {
# Count errors # Count errors
errorCount=0 errorCount=0
# Verify that Installomator has been installed for what in $whatList; do
destFile="/usr/local/Installomator/Installomator.sh" #echo $what
if [ ! -e "${destFile}" ]; then # Install software using Installomator
echo "Installomator not found here:" cmdOutput="$(${destFile} ${what} LOGO=addigy $parameters || true)"
echo "${destFile}" # Check result
echo "Exiting." exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
caffexit 99 if [[ ${exitStatus} -ne 0 ]] ; then
fi echo -e "Error installing ${what}. Exit code ${exitStatus}"
#echo "$cmdOutput"
for item in $what; do errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo $item echo "$errorOutput"
${destFile} ${item} LOGO=addigy NOTIFY=silent BLOCKING_PROCESS_ACTION=quit_kill #INSTALL=force
if [ $? != 0 ]; then
# Error handling
echo "[$(DATE)] Error installing ${item}. Exit code $?"
let errorCount++ let errorCount++
fi fi
done done
@@ -56,7 +71,7 @@ caffexit $errorCount
# Install on success # Install on success
# Remember to fill out the correct “TARGET_VERSION” and “PKG_ID”, and click "Install on succes". # Remember to fill out the correct “TARGET_VERSION” and “PKG_ID”, and click "Install on succes".
PKG_ID="com.scriptingosx.Installomator" PKG_ID="com.scriptingosx.Installomator"
TARGET_VERSION="8.0" TARGET_VERSION="9.1"
vercomp () { vercomp () {
if [[ $1 == $2 ]]; then if [[ $1 == $2 ]]; then

View File

@@ -1,10 +1,11 @@
PKG_ID="com.scriptingosx.Installomator" PKG_ID="com.scriptingosx.Installomator"
TARGET_VERSION="8.0" TARGET_VERSION="9.1"
URLDOWNLOAD="%MosyleCDNFile:blah-blah-blah%" URLDOWNLOAD="%MosyleCDNFile:blah-blah-blah%"
###################################################################### ######################################################################
# Installation using Installomator (enter the software to install separated with spaces in the "what"-variable) # Installation using Installomator (enter the software to install separated with spaces in the "whatList"-variable)
what="handbrake theunarchiver microsoftoffice365" whatList="handbrake theunarchiver microsoftoffice365"
# Covered by Mosyle Catalog: "brave firefox googlechrome microsoftedge microsoftteams signal sublimetext vlc webex zoom" among others # Covered by Mosyle Catalog: "brave firefox googlechrome microsoftedge microsoftteams signal sublimetext vlc webex zoom" among others
LOGO="mosyleb" # or "mosylem"
###################################################################### ######################################################################
## Mark: Code here ## Mark: Code here
@@ -56,12 +57,17 @@ if [ ! -e "${destFile}" ]; then
caffexit 99 caffexit 99
fi fi
for item in $what; do for what in $whatList; do
#echo $item #echo $item
${destFile} ${item} LOGO=mosyle NOTIFY=all BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=silent BLOCKING_PROCESS_ACTION=quit_kill #INSTALL=force # Install software using Installomator
if [ $? != 0 ]; then cmdOutput="$(${destFile} ${what} LOGO=$LOGO NOTIFY=all BLOCKING_PROCESS_ACTION=tell_user || true)" # NOTIFY=silent BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force
# Error handling # Check result
echo "[$(DATE)] Error installing ${item}. Exit code $?" exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -ne 0 ]] ; then
echo "Error installing ${what}. Exit code ${exitStatus}"
#echo "$cmdOutput"
errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
echo "$errorOutput"
let errorCount++ let errorCount++
fi fi
done done

View File

@@ -1,8 +1,20 @@
#!/bin/bash #!/bin/bash
# Software
# Installation using Installomator # Installation using Installomator
# Example of installing software using valuesfromarguments to install a custom software # Example of installing software using valuesfromarguments to install a custom software
what="valuesfromarguments" # enter the software to install LOGO="appstore" # or "addigy", "microsoft", "mosyleb", "mosylem"
###############################################
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping # No sleeping
/usr/bin/caffeinate -d -i -m -u & /usr/bin/caffeinate -d -i -m -u &
@@ -13,29 +25,31 @@ caffexit () {
exit $1 exit $1
} }
# Verify that Installomator has been installed # Variables to calculate
destFile="/usr/local/Installomator/Installomator.sh" downloadURL="https://craft-assets.invisionapp.com/CraftManager/production/CraftManager.zip"
if [ ! -e "${destFile}" ]; then appNewVersion=$(curl -fs https://craft-assets.invisionapp.com/CraftManager/production/appcast.xml | xpath -e '//rss/channel/item[1]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f2)
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
caffexit 99
fi
${destFile} valuesfromarguments \ # Install software using Installomator
name=\"Zoho\ WorkDrive\" \ cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
type=dmg \ name=CraftManager \
downloadURL=https://files-accl.zohopublic.com/public/wdbin/download/46f971e4fc4a32b68ad5d7dade38a7d2 \ type=zip \
appNewVersion=2.6.25 \ downloadURL=$downloadURL \
expectedTeamID=TZ824L8Y37 \ appNewVersion=$appNewVersion \
BLOCKING_PROCESS_ACTION=quit \ expectedTeamID=VRXQSNCL5W \
NOTIFY=all BLOCKING_PROCESS_ACTION=prompt_user \
LOGGING=REQ \
NOTIFY=all || true)"
# ${destFile} ${what} BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent # Check result
if [ $? != 0 ]; then exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle! if [[ ${exitStatus} -eq 0 ]] ; then
echo "Error installing ${what}. Exit code $?" echo -e "${what} succesfully installed.\n"
caffexit $? else
echo -e "Error installing ${what}. Exit code ${exitStatus}\n"
#printlog "$cmdOutput"
errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
echo "$errorOutput"
caffexit $exitStatus
fi fi
echo "[$(DATE)][LOG-END]" echo "[$(DATE)][LOG-END]"