Improved logging

Overall purpose was to improve the logging in the scripts. But the handling of macOS version and Installomator version in order to utilize swiftDialog has been improved, too.
This commit is contained in:
Theile
2022-10-24 12:38:46 +02:00
parent 2362e8a9d0
commit e22a7754bd
14 changed files with 62 additions and 32 deletions

View File

@@ -5,6 +5,10 @@
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
# Have the label been submittet in a PR for Installomator?
# What version of Installomator is it expected to be included in?
# Version 10.0
item="gfxcardstatus" # enter the software to install (if it has a label in future version of Installomator)
# Label variables below
@@ -104,9 +108,10 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dial
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Fill out the label variables above, and those will be included in the Installomator call, circa on line 248
# Script will run this label through Installomator.
######################################################################
# v. 10.0.3 : A bit more logging on succes, and change in ending Dialog part.
# v. 10.0.2 : Improved icon checks and failovers
# v. 10.0.1 : github-functions added. Improved appIcon handling. Can add the app to Dock using dockutil.
# v. 10.0 : Integration with Dialog and Installomator v. 10
@@ -119,6 +124,10 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
if [[ -z "$item" ]]; then
item="$name"
fi
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
@@ -176,7 +185,7 @@ caffexit () {
# Mark: Installation begins
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion | cut -c1-2) -lt 20 ]]; then
echo "Skipping swiftDialog UI, using notifications."
#echo "Installomator should be at least version 10 to support swiftDialog. Installed version $installomatorVersion."
#echo "And macOS 11 Big Sur (build 20A) is required for swiftDialog. Installed build $(sw_vers -buildVersion)."
@@ -323,7 +332,7 @@ else
fi
# Mark: Ending
if [[ $installomatorVersion -ge 10 ]] && [[ $(sw_vers -buildVersion) >= "20" ]]; then
if [[ $installomatorVersion -ge 10 && $(sw_vers -buildVersion | cut -c1-2) -ge 20 ]]; then
# close and quit dialog
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"