App-update scripts

And added a bit to the README.md.
This commit is contained in:
Theile
2022-09-29 13:07:42 +02:00
parent 3d2c72a672
commit c955a69e47
3 changed files with 203 additions and 2 deletions

View File

@@ -0,0 +1,92 @@
#!/bin/sh
# Update with Installomator if app exist
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="microsoftedge" # enter the software to install
# Examples: brave, duckduckgo, firefoxpkg, googlechromepkg, microsoftedge, opera
appPath="/Applications/Microsoft Edge.app"
# Examples: Microsoft Edge.app, Brave Browser.app, DuckDuckGo.app, Google Chrome.app, Firefox.app, Opera.app
installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
# Check if app is installed
# We only want this to run if it's already installed
if [ ! -e "${appPath}" ]; then
echo "App not found here:"
echo "${appPath}"
echo "Exiting."
exit 98
fi
echo "${appPath} Found!"
# 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
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -0,0 +1,92 @@
#!/bin/sh
# Update with Installomator if app exist
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="" # enter the software to install
# Examples: cyberduck, handbrake, textmate, vlc
appPath="/Applications/Cyberduck.app"
# Examples: Cyberduck.app, Handbrake.app, Textmate.app, VLC.app
installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
# Check if app is installed
# We only want this to run if it's already installed
if [ ! -e "${appPath}" ]; then
echo "App not found here:"
echo "${appPath}"
echo "Exiting."
exit 98
fi
echo "${appPath} Found!"
# 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
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus