From 9ef19139d2ab8da98177984f53993bcc0d4a7e0c Mon Sep 17 00:00:00 2001 From: Theile Date: Fri, 21 Oct 2022 09:50:26 +0200 Subject: [PATCH 01/12] Improved logging --- .../App VFA SS github.sh | 11 +++++++---- .../App VFA SS.sh | 11 +++++++---- .../App browser-security SS.sh | 11 +++++++---- .../App normal SS multi-app.sh | 11 +++++++---- .../App normal SS.sh | 11 +++++++---- .../App service SS.sh | 11 +++++++---- 6 files changed, 42 insertions(+), 24 deletions(-) diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh index a235945..ec42027 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh @@ -134,8 +134,10 @@ checkCmdOutput () { 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" + echo "$selectedOutput" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" @@ -177,8 +179,9 @@ caffexit () { installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)" if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then - echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion." - echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)." + 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)." installomatorNotify="NOTIFY=all" else installomatorNotify="NOTIFY=silent" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh index 2089f9b..ed36def 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh @@ -81,8 +81,10 @@ checkCmdOutput () { 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" + echo "$selectedOutput" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" @@ -124,8 +126,9 @@ caffexit () { installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)" if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then - echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion." - echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)." + 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)." installomatorNotify="NOTIFY=all" else installomatorNotify="NOTIFY=silent" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh index 8e59aba..3efdfdd 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh @@ -72,8 +72,10 @@ checkCmdOutput () { 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" + echo "$selectedOutput" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" @@ -115,8 +117,9 @@ caffexit () { installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)" if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then - echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion." - echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)." + 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)." installomatorNotify="NOTIFY=all" else installomatorNotify="NOTIFY=silent" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh index 0cc2af9..ce2d5f9 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh @@ -72,8 +72,10 @@ checkCmdOutput () { 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" + echo "$selectedOutput" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" @@ -115,8 +117,9 @@ caffexit () { installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)" if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then - echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion." - echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)." + 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)." installomatorNotify="NOTIFY=all" else installomatorNotify="NOTIFY=silent" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh index 77f7add..49d374f 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh @@ -69,8 +69,10 @@ checkCmdOutput () { 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" + echo "$selectedOutput" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" @@ -112,8 +114,9 @@ caffexit () { installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)" if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then - echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion." - echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)." + 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)." installomatorNotify="NOTIFY=all" else installomatorNotify="NOTIFY=silent" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh index 67d1f56..40aeb18 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh @@ -72,8 +72,10 @@ checkCmdOutput () { 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" + echo "$selectedOutput" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" @@ -115,8 +117,9 @@ caffexit () { installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)" if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then - echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion." - echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)." + 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)." installomatorNotify="NOTIFY=all" else installomatorNotify="NOTIFY=silent" From 8b19773a7fa249fa37d39193b3e9646d4cf8efc6 Mon Sep 17 00:00:00 2001 From: Theile Date: Fri, 21 Oct 2022 10:38:58 +0200 Subject: [PATCH 02/12] Correcting logging --- .../App VFA SS github.sh | 4 +--- .../App VFA SS.sh | 4 +--- .../App browser-security SS.sh | 4 +--- .../App normal SS multi-app.sh | 4 +--- .../App normal SS.sh | 4 +--- .../App service SS.sh | 4 +--- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh index ec42027..0130d46 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh @@ -134,9 +134,7 @@ checkCmdOutput () { 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" - echo "$selectedOutput" - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh index ed36def..57a08db 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh @@ -81,9 +81,7 @@ checkCmdOutput () { 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" - echo "$selectedOutput" - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh index 3efdfdd..7bddd7f 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh @@ -72,9 +72,7 @@ checkCmdOutput () { 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" - echo "$selectedOutput" - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh index ce2d5f9..72c674c 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh @@ -72,9 +72,7 @@ checkCmdOutput () { 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" - echo "$selectedOutput" - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh index 49d374f..0cf925c 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh @@ -69,9 +69,7 @@ checkCmdOutput () { 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" - echo "$selectedOutput" - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh index 40aeb18..6d9ca83 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh @@ -72,9 +72,7 @@ checkCmdOutput () { 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": warn" || true )" - echo "$selectedOutput" - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i ": req" || true )" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" From 03177d4e9de1fb1fd668c94180e37a12a46f37ba Mon Sep 17 00:00:00 2001 From: Theile Date: Fri, 21 Oct 2022 10:39:22 +0200 Subject: [PATCH 03/12] Get Installomator.log from client --- MDM/Collect Installomator.log.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 MDM/Collect Installomator.log.sh diff --git a/MDM/Collect Installomator.log.sh b/MDM/Collect Installomator.log.sh new file mode 100644 index 0000000..c0af18d --- /dev/null +++ b/MDM/Collect Installomator.log.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# A small script to grab Installomator log from a client Mac. +# Can be sent to the client so the result can be seen in MDM +# Only uncomment the line below for the things you want to see. + +logFile="/var/log/Installomator.log" + +# Show latest 100 lines of the log +tail -100 "${logFile}" + +# Show latest 500 lines but filter to REQ|ERROR|WARN lines +# Great overview of the log +#tail -500 "${logFile}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" + +# Show only one label +# Great to see everything for a label that might fail or not working as expected +label="valuesfromarguments" +#cat "${logFile}" | grep --binary-files=text ": ${label}" From 2a0385d30dde2d51b2f479e3a58f593f8ca717fe Mon Sep 17 00:00:00 2001 From: Theile Date: Fri, 21 Oct 2022 13:05:55 +0200 Subject: [PATCH 04/12] Check to see if Dialog CLI is also there --- MDM/Progress 1st swiftDialog.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/MDM/Progress 1st swiftDialog.sh b/MDM/Progress 1st swiftDialog.sh index f279d3d..7f7a98e 100755 --- a/MDM/Progress 1st swiftDialog.sh +++ b/MDM/Progress 1st swiftDialog.sh @@ -245,6 +245,7 @@ versionKey="CFBundleShortVersionString" #CFBundleVersion currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)" printlog "${name} version: $currentInstalledVersion" +destFile="/usr/local/bin/dialog" if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then printlog "$name not found or version not latest." printlog "${destFile}" From a7224fcbeafc6987b913bcf9293d60205682ca8b Mon Sep 17 00:00:00 2001 From: Theile Date: Fri, 21 Oct 2022 13:07:19 +0200 Subject: [PATCH 05/12] Check to see if dialog CLI is also there --- MDM/install swiftDialog direct.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/MDM/install swiftDialog direct.sh b/MDM/install swiftDialog direct.sh index c29d299..d318b2f 100755 --- a/MDM/install swiftDialog direct.sh +++ b/MDM/install swiftDialog direct.sh @@ -80,6 +80,7 @@ versionKey="CFBundleShortVersionString" #CFBundleVersion currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)" printlog "${name} version: $currentInstalledVersion" +destFile="/usr/local/bin/dialog" if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then printlog "$name not found or version not latest." printlog "${destFile}" From 2362e8a9d0a652ef0158cc4fe5af1895a26bc805 Mon Sep 17 00:00:00 2001 From: Theile Date: Fri, 21 Oct 2022 14:01:59 +0200 Subject: [PATCH 06/12] Improved logging --- .../App VFA SS github.sh | 22 +++++++------- .../App VFA SS.sh | 29 ++++++++++--------- .../App browser-security SS.sh | 18 +++++------- .../App normal SS multi-app.sh | 18 +++++------- .../App normal SS.sh | 18 +++++------- .../App service SS.sh | 18 +++++------- 6 files changed, 57 insertions(+), 66 deletions(-) diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh index 0130d46..da61b17 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh @@ -5,7 +5,7 @@ LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1" -#item="gfxcardstatus" # enter the software to install (if it has a label in future version of Installomator) +item="gfxcardstatus" # enter the software to install (if it has a label in future version of Installomator) # Label variables below @@ -129,19 +129,19 @@ dialogUpdate() { fi } checkCmdOutput () { - # $1: cmdOutput - local cmdOutput="$1" - exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )" + local checkOutput="$1" + exitStatus="$( echo "${checkOutput}" | 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" - echo "$cmdOutput" - #errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" + echo "$checkOutput" + #errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )" #echo "$errorOutput" fi + #echo "$checkOutput" } # Check the currently logged in user @@ -295,7 +295,7 @@ fi # Install software using Installomator with valuesfromarguments cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \ - name=${name} \ + name=\"${name}\" \ type=${type} \ packageID=${packageID} \ downloadURL=\"$downloadURL\" \ @@ -304,7 +304,7 @@ cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \ expectedTeamID=${expectedTeamID} \ ${installomatorOptions} ${installomatorNotify} || true)" -checkCmdOutput $cmdOutput +checkCmdOutput "${cmdOutput}" # Mark: dockutil stuff if [[ $addToDock -eq 1 ]]; then @@ -323,9 +323,7 @@ else fi # Mark: Ending -if [[ $installomatorVersion -lt 10 ]]; then - echo "Again skipping Dialog stuff." -else +if [[ $installomatorVersion -ge 10 ]] && [[ $(sw_vers -buildVersion) >= "20" ]]; then # close and quit dialog dialogUpdate "progress: complete" dialogUpdate "progresstext: Done" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh index 57a08db..e4670ca 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh @@ -5,15 +5,14 @@ LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1" -#item="" # enter the software to install (if it has a label in future version of Installomator) +item="clickshare" # enter the software to install (if it has a label in future version of Installomator) # Variables for label -name="ClickShare" +name="ClickShare" # Spaces in the name will not work type="appInDmgInZip" packageID="" downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )" appNewVersion="$(eval "$( echo $downloadURL | sed -E 's/.*(MajorVersion.*BuildVersion=[0-9]*).*/\1/' | sed 's/&//g' )" ; ((MajorVersion++)) ; ((MajorVersion--)); ((MinorVersion++)) ; ((MinorVersion--)); ((PatchVersion++)) ; ((PatchVersion--)); ((BuildVersion++)) ; ((BuildVersion--)); echo "${MajorVersion}.${MinorVersion}.${PatchVersion}-b${BuildVersion}")" -versionKey="" expectedTeamID="P6CDJZR997" # Dialog icon @@ -66,6 +65,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" @@ -76,24 +79,24 @@ dialogUpdate() { fi } checkCmdOutput () { - # $1: cmdOutput - local cmdOutput="$1" - exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )" + local checkOutput="$1" + exitStatus="$( echo "${checkOutput}" | 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" - echo "$cmdOutput" - #errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" + echo "$checkOutput" + #errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )" #echo "$errorOutput" fi + #echo "$checkOutput" } # Check the currently logged in user currentUser=$(stat -f "%Su" /dev/console) -if [ -z "$currentUser" ] || [ "$currentUser" = "loginwindow" ] || [ "$currentUser" = "_mbsetupuser" ] || [ "$currentUser" = "root" ]; then +if [[ -z "$currentUser" ]] || [[ "$currentUser" = "loginwindow" ]] || [[ "$currentUser" = "_mbsetupuser" ]] || [[ "$currentUser" = "root" ]]; then echo "ERROR. Logged in user is $currentUser! Cannot proceed." exit 97 fi @@ -251,7 +254,7 @@ cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \ expectedTeamID=${expectedTeamID} \ ${installomatorOptions} ${installomatorNotify} || true)" -checkCmdOutput $cmdOutput +checkCmdOutput "${cmdOutput}" # Mark: dockutil stuff if [[ $addToDock -eq 1 ]]; then @@ -270,9 +273,7 @@ else fi # Mark: Ending -if [[ $installomatorVersion -lt 10 ]]; then - echo "Again skipping Dialog stuff." -else +if [[ $installomatorVersion -ge 10 ]] && [[ $(sw_vers -buildVersion) >= "20" ]]; then # close and quit dialog dialogUpdate "progress: complete" dialogUpdate "progresstext: Done" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh index 7bddd7f..6e43de4 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh @@ -67,19 +67,19 @@ dialogUpdate() { fi } checkCmdOutput () { - # $1: cmdOutput - local cmdOutput="$1" - exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )" + local checkOutput="$1" + exitStatus="$( echo "${checkOutput}" | 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" - echo "$cmdOutput" - #errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" + echo "$checkOutput" + #errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )" #echo "$errorOutput" fi + #echo "$checkOutput" } # Check the currently logged in user @@ -233,7 +233,7 @@ fi # Install software using Installomator cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)" -checkCmdOutput $cmdOutput +checkCmdOutput "${cmdOutput}" # Mark: dockutil stuff if [[ $addToDock -eq 1 ]]; then @@ -252,9 +252,7 @@ else fi # Mark: Ending -if [[ $installomatorVersion -lt 10 ]]; then - echo "Again skipping Dialog stuff." -else +if [[ $installomatorVersion -ge 10 ]] && [[ $(sw_vers -buildVersion) >= "20" ]]; then # close and quit dialog dialogUpdate "progress: complete" dialogUpdate "progresstext: Done" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh index 72c674c..99e1e0a 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh @@ -67,19 +67,19 @@ dialogUpdate() { fi } checkCmdOutput () { - # $1: cmdOutput - local cmdOutput="$1" - exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )" + local checkOutput="$1" + exitStatus="$( echo "${checkOutput}" | 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" - echo "$cmdOutput" - #errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" + echo "$checkOutput" + #errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )" #echo "$errorOutput" fi + #echo "$checkOutput" } # Check the currently logged in user @@ -233,7 +233,7 @@ fi # Install software using Installomator cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)" -checkCmdOutput $cmdOutput +checkCmdOutput "${cmdOutput}" # Mark: dockutil stuff if [[ $addToDock -eq 1 ]]; then @@ -255,9 +255,7 @@ else fi # Mark: Ending -if [[ $installomatorVersion -lt 10 ]]; then - echo "Again skipping Dialog stuff." -else +if [[ $installomatorVersion -ge 10 ]] && [[ $(sw_vers -buildVersion) >= "20" ]]; then # close and quit dialog dialogUpdate "progress: complete" dialogUpdate "progresstext: Done" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh index 0cf925c..21ac560 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh @@ -64,19 +64,19 @@ dialogUpdate() { fi } checkCmdOutput () { - # $1: cmdOutput - local cmdOutput="$1" - exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )" + local checkOutput="$1" + exitStatus="$( echo "${checkOutput}" | 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" - echo "$cmdOutput" - #errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" + echo "$checkOutput" + #errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )" #echo "$errorOutput" fi + #echo "$checkOutput" } # Check the currently logged in user @@ -230,7 +230,7 @@ fi # Install software using Installomator cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)" -checkCmdOutput $cmdOutput +checkCmdOutput "${cmdOutput}" # Mark: dockutil stuff if [[ $addToDock -eq 1 ]]; then @@ -249,9 +249,7 @@ else fi # Mark: Ending -if [[ $installomatorVersion -lt 10 ]]; then - echo "Again skipping Dialog stuff." -else +if [[ $installomatorVersion -ge 10 ]] && [[ $(sw_vers -buildVersion) >= "20" ]]; then # close and quit dialog dialogUpdate "progress: complete" dialogUpdate "progresstext: Done" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh index 6d9ca83..c29debf 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh @@ -67,19 +67,19 @@ dialogUpdate() { fi } checkCmdOutput () { - # $1: cmdOutput - local cmdOutput="$1" - exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )" + local checkOutput="$1" + exitStatus="$( echo "${checkOutput}" | 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." - selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" - echo "$cmdOutput" - #errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" + echo "$checkOutput" + #errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )" #echo "$errorOutput" fi + #echo "$checkOutput" } # Check the currently logged in user @@ -233,7 +233,7 @@ fi # Install software using Installomator cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)" -checkCmdOutput $cmdOutput +checkCmdOutput "${cmdOutput}" # Mark: dockutil stuff if [[ $addToDock -eq 1 ]]; then @@ -252,9 +252,7 @@ else fi # Mark: Ending -if [[ $installomatorVersion -lt 10 ]]; then - echo "Again skipping Dialog stuff." -else +if [[ $installomatorVersion -ge 10 ]] && [[ $(sw_vers -buildVersion) >= "20" ]]; then # close and quit dialog dialogUpdate "progress: complete" dialogUpdate "progresstext: Done" From e22a7754bdc243700fae9d46230e85307fbf4273 Mon Sep 17 00:00:00 2001 From: Theile Date: Mon, 24 Oct 2022 12:38:46 +0200 Subject: [PATCH 07/12] 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. --- .../App VFA SS github.sh | 15 ++++++++++++--- .../App VFA SS.sh | 15 ++++++++++----- .../App browser-security SS.sh | 5 +++-- .../App normal SS multi-app.sh | 5 +++-- .../App normal SS.sh | 5 +++-- .../App service SS.sh | 5 +++-- MDM/App-install/App VFA.sh | 13 +++++++++---- .../App browser-security Auto-install.sh | 1 + MDM/App-install/App browser-security SS.sh | 5 +++-- MDM/App-install/App normal Auto-install.sh | 5 +++-- MDM/App-install/App normal SS.sh | 5 +++-- MDM/App-install/App service Auto-install.sh | 5 +++-- .../App browser-security Auto-install.sh | 5 +++-- MDM/App-update/App normal Auto-install.sh | 5 +++-- 14 files changed, 62 insertions(+), 32 deletions(-) diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh index da61b17..b664cf9 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh @@ -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" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh index e4670ca..aa0b228 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh @@ -5,10 +5,14 @@ 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="clickshare" # enter the software to install (if it has a label in future version of Installomator) # Variables for label -name="ClickShare" # Spaces in the name will not work +name="ClickShare" # If spaces in the name, fill out "${name}" in Installomator-call below, circa line 249. Spaces should be escaped in that line. type="appInDmgInZip" packageID="" downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )" @@ -50,9 +54,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 : Improved appIcon handling. Can add the app to Dock using dockutil # v. 10.0 : Integration with Dialog and Installomator v. 10 @@ -126,7 +131,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)." @@ -245,7 +250,7 @@ fi # Install software using Installomator with valuesfromarguments cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \ - name=${name} \ + name=\"${name}\" \ type=${type} \ packageID=${packageID} \ downloadURL=\"$downloadURL\" \ @@ -273,7 +278,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" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh index 6e43de4..5524428 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh @@ -45,6 +45,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit DIALOG_CMD_FIL # Fill the variable "item" above with a label. # 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 : Improved appIcon handling. Can add the app to Dock using dockutil # v. 10.0 : Integration with Dialog and Installomator v. 10 @@ -114,7 +115,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)." @@ -252,7 +253,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" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh index 99e1e0a..839d091 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh @@ -45,6 +45,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dial # Fill the variable "item" above with a label. # 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 : Improved appIcon handling. Can add the app to Dock using dockutil # v. 10.0 : Integration with Dialog and Installomator v. 10 @@ -114,7 +115,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)." @@ -255,7 +256,7 @@ else fi # Mark: Ending -if [[ $installomatorVersion -ge 10 ]] && [[ $(sw_vers -buildVersion) >= "20" ]]; then +iif [[ $installomatorVersion -ge 10 && $(sw_vers -buildVersion | cut -c1-2) -ge 20 ]]; then # close and quit dialog dialogUpdate "progress: complete" dialogUpdate "progresstext: Done" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh index 21ac560..77a03d4 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh @@ -42,6 +42,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dial # Fill the variable "item" above with a label. # 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 : Improved appIcon handling. Can add the app to Dock using dockutil # v. 10.0 : Integration with Dialog and Installomator v. 10 @@ -111,7 +112,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)." @@ -249,7 +250,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" diff --git a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh index c29debf..d2c90bb 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh @@ -45,6 +45,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent DIALOG_CMD_FI # Fill the variable "item" above with a label. # 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 : Can add the app to Dock using dockutil # v. 10.0 : Integration with Dialog and Installomator v. 10 @@ -114,7 +115,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)." @@ -252,7 +253,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" diff --git a/MDM/App-install/App VFA.sh b/MDM/App-install/App VFA.sh index 3162a67..ad9fd73 100755 --- a/MDM/App-install/App VFA.sh +++ b/MDM/App-install/App VFA.sh @@ -5,10 +5,14 @@ LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1" -#item="" # enter the software to install (if it has a label in future version of Installomator) +# Have the label been submittet in a PR for Installomator? +# What version of Installomator is it expected to be included in? +# Version 10 + +item="" # enter the software to install (if it has a label in future version of Installomator) # Variables for label -name="ClickShare" +name="ClickShare" # Spaces in the name will not work type="appInDmgInZip" packageID="" downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )" @@ -40,6 +44,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user LOGGING=INFO NOTIFY=al # Fill the variable "what" above with a label. # Script will run this label through Installomator. ###################################################################### +# v. 9.2.2 : A bit more logging on succes. # v. 9.2.1 : Better logging handling and installomatorOptions fix. ###################################################################### @@ -84,8 +89,8 @@ cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \ 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 "${what} succesfully installed." - warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )" - echo "$warnOutput" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + echo "$selectedOutput" else echo "ERROR installing ${what}. Exit code ${exitStatus}" echo "$cmdOutput" diff --git a/MDM/App-install/App browser-security Auto-install.sh b/MDM/App-install/App browser-security Auto-install.sh index c45b568..8dfd6d6 100644 --- a/MDM/App-install/App browser-security Auto-install.sh +++ b/MDM/App-install/App browser-security Auto-install.sh @@ -31,6 +31,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit" # Separated b # Fill the variable "item" above with a label. # Script will run this label through Installomator. ###################################################################### +# v. 9.2.2 : A bit more logging on succes. # v. 9.2.1 : Better logging handling and installomatorOptions fix. ###################################################################### diff --git a/MDM/App-install/App browser-security SS.sh b/MDM/App-install/App browser-security SS.sh index 83c8b12..fac4e7b 100644 --- a/MDM/App-install/App browser-security SS.sh +++ b/MDM/App-install/App browser-security SS.sh @@ -31,6 +31,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit NOTIFY=all" # # Fill the variable "what" above with a label. # Script will run this label through Installomator. ###################################################################### +# v. 9.2.2 : A bit more logging on succes. # v. 9.2.1 : Better logging handling and installomatorOptions fix. ###################################################################### @@ -65,8 +66,8 @@ cmdOutput="$(${destFile} ${what} LOGO=$LOGO ${installomatorOptions} || true)" 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 "${what} succesfully installed." - warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )" - echo "$warnOutput" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + echo "$selectedOutput" else echo "ERROR installing ${what}. Exit code ${exitStatus}" echo "$cmdOutput" diff --git a/MDM/App-install/App normal Auto-install.sh b/MDM/App-install/App normal Auto-install.sh index 986b054..4e22dce 100644 --- a/MDM/App-install/App normal Auto-install.sh +++ b/MDM/App-install/App normal Auto-install.sh @@ -31,6 +31,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user" # Separated by space # Fill the variable "item" above with a label. # Script will run this label through Installomator. ###################################################################### +# v. 9.2.2 : A bit more logging on succes. # v. 9.2.1 : Better logging handling and installomatorOptions fix. ###################################################################### @@ -65,8 +66,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)" 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" diff --git a/MDM/App-install/App normal SS.sh b/MDM/App-install/App normal SS.sh index 06f7c04..8601f37 100644 --- a/MDM/App-install/App normal SS.sh +++ b/MDM/App-install/App normal SS.sh @@ -32,6 +32,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all" # Separate # Fill the variable "item" above with a label. # Script will run this label through Installomator. ###################################################################### +# v. 9.2.2 : A bit more logging on succes. # v. 9.2.1 : Better logging handling and installomatorOptions fix. ###################################################################### @@ -66,8 +67,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)" 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" diff --git a/MDM/App-install/App service Auto-install.sh b/MDM/App-install/App service Auto-install.sh index aa7165e..ef191e6 100644 --- a/MDM/App-install/App service Auto-install.sh +++ b/MDM/App-install/App service Auto-install.sh @@ -31,6 +31,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent" # Separated # Fill the variable "item" above with a label. # Script will run this label through Installomator. ###################################################################### +# v. 9.2.2 : A bit more logging on succes. # v. 9.2.1 : Better logging handling and installomatorOptions fix. ###################################################################### @@ -65,8 +66,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)" 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" diff --git a/MDM/App-update/App browser-security Auto-install.sh b/MDM/App-update/App browser-security Auto-install.sh index 211e564..53d5fd9 100644 --- a/MDM/App-update/App browser-security Auto-install.sh +++ b/MDM/App-update/App browser-security Auto-install.sh @@ -33,6 +33,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit" # Separated b # Fill the variable "item" above with a label. # Script will run this label through Installomator. ###################################################################### +# v. 9.2.2 : A bit more logging on succes. # v. 9.2.1 : Better logging handling and installomatorOptions fix. ###################################################################### @@ -77,8 +78,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)" 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" diff --git a/MDM/App-update/App normal Auto-install.sh b/MDM/App-update/App normal Auto-install.sh index c2ac671..870c53a 100644 --- a/MDM/App-update/App normal Auto-install.sh +++ b/MDM/App-update/App normal Auto-install.sh @@ -33,6 +33,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user" # Separated by space # Fill the variable "item" above with a label. # Script will run this label through Installomator. ###################################################################### +# v. 9.2.2 : A bit more logging on succes. # v. 9.2.1 : Better logging handling and installomatorOptions fix. ###################################################################### @@ -77,8 +78,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)" 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" From dfc9950a3182f72ebcdcccc1db0848303ab7af2c Mon Sep 17 00:00:00 2001 From: Theile Date: Mon, 24 Oct 2022 12:39:04 +0200 Subject: [PATCH 08/12] Update App browser-security Auto-install.sh --- MDM/App-install/App browser-security Auto-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MDM/App-install/App browser-security Auto-install.sh b/MDM/App-install/App browser-security Auto-install.sh index 8dfd6d6..c2c8a8b 100644 --- a/MDM/App-install/App browser-security Auto-install.sh +++ b/MDM/App-install/App browser-security Auto-install.sh @@ -66,8 +66,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)" 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" + selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )" + echo "$selectedOutput" else echo "ERROR installing ${item}. Exit code ${exitStatus}" echo "$cmdOutput" From a8a1082d34526825f7eeb44835660045f896d5d2 Mon Sep 17 00:00:00 2001 From: Theile Date: Mon, 24 Oct 2022 13:10:15 +0200 Subject: [PATCH 09/12] Final log-fixes --- .../App VFA SS github.sh | 4 ++-- .../App VFA SS.sh | 4 ++-- .../App browser-security SS.sh | 4 ++-- .../App normal SS multi-app.sh | 4 ++-- .../App normal SS.sh | 4 ++-- .../App service SS.sh | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh index b664cf9..636ac1b 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh @@ -197,7 +197,7 @@ else echo "Cannot find dialog at $dialogApp" # Install using Installlomator cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi # Configure and display swiftDialog @@ -322,7 +322,7 @@ if [[ $addToDock -eq 1 ]]; then echo "Cannot find dockutil at $dockutil, trying installation" # Install using Installlomator cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi echo "Adding to Dock" $dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh index aa0b228..97a43cb 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh @@ -143,7 +143,7 @@ else echo "Cannot find dialog at $dialogApp" # Install using Installlomator cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi # Configure and display swiftDialog @@ -268,7 +268,7 @@ if [[ $addToDock -eq 1 ]]; then echo "Cannot find dockutil at $dockutil, trying installation" # Install using Installlomator cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi echo "Adding to Dock" $dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true diff --git a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh index 5524428..a08b272 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh @@ -127,7 +127,7 @@ else echo "Cannot find dialog at $dialogApp" # Install using Installlomator cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi # Configure and display swiftDialog @@ -243,7 +243,7 @@ if [[ $addToDock -eq 1 ]]; then echo "Cannot find dockutil at $dockutil, trying installation" # Install using Installlomator cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi echo "Adding to Dock" $dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh index 839d091..6a114e0 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh @@ -127,7 +127,7 @@ else echo "Cannot find dialog at $dialogApp" # Install using Installlomator cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi # Configure and display swiftDialog @@ -243,7 +243,7 @@ if [[ $addToDock -eq 1 ]]; then echo "Cannot find dockutil at $dockutil, trying installation" # Install using Installlomator cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi echo "Adding to Dock" for appPath in "${appPaths[@]}"; do diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh index 77a03d4..7d4c231 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh @@ -124,7 +124,7 @@ else echo "Cannot find dialog at $dialogApp" # Install using Installlomator cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi # Configure and display swiftDialog @@ -240,7 +240,7 @@ if [[ $addToDock -eq 1 ]]; then echo "Cannot find dockutil at $dockutil, trying installation" # Install using Installlomator cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi echo "Adding to Dock" $dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true diff --git a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh index d2c90bb..4e53575 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh @@ -127,7 +127,7 @@ else echo "Cannot find dialog at $dialogApp" # Install using Installlomator cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi # Configure and display swiftDialog @@ -243,7 +243,7 @@ if [[ $addToDock -eq 1 ]]; then echo "Cannot find dockutil at $dockutil, trying installation" # Install using Installlomator cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)" - checkCmdOutput $cmdOutput + checkCmdOutput "${cmdOutput}" fi echo "Adding to Dock" $dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true From afc906161acd2ee95c9965ae6bd239fe50ea4e1e Mon Sep 17 00:00:00 2001 From: Theile Date: Tue, 25 Oct 2022 10:48:52 +0200 Subject: [PATCH 10/12] Minor change in NOTIFY setting, that was missed --- .../App service SS.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh index 4e53575..9bacc2f 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh @@ -21,7 +21,7 @@ dialog_command_file="/var/tmp/dialog.log" dialogApp="/Library/Application Support/Dialog/Dialog.app" dockutil="/usr/local/bin/dockutil" -installomatorOptions="BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space +installomatorOptions="BLOCKING_PROCESS_ACTION=ignore DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space # Other installomatorOptions: # LOGGING=REQ From 98f0fb1a7767939f8f7f96628dfcf2f826b04ea5 Mon Sep 17 00:00:00 2001 From: Theile Date: Tue, 25 Oct 2022 20:57:11 +0200 Subject: [PATCH 11/12] Many fewer icon logs. --- .../App VFA SS github.sh | 16 ++++++++-------- .../App VFA SS.sh | 16 ++++++++-------- .../App browser-security SS.sh | 16 ++++++++-------- .../App normal SS multi-app.sh | 16 ++++++++-------- .../App normal SS.sh | 16 ++++++++-------- .../App service SS.sh | 16 ++++++++-------- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh index 636ac1b..4b19b9c 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh @@ -210,24 +210,24 @@ else echo "$item $itemName" #Check icon (expecting beginning with “http” to be web-link and “/” to be disk file) - echo "icon before check: $icon" + #echo "icon before check: $icon" if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then - echo "icon looks to be web-link" + #echo "icon looks to be web-link" if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then - echo "ERROR: Cannot download link. Reset icon." + echo "ERROR: Cannot download ${icon} link. Reset icon." icon="" fi elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then - echo "icon looks to be a file" + #echo "icon looks to be a file" if [[ ! -a "${icon}" ]]; then - echo "ERROR: Cannot find file. Reset icon." + echo "ERROR: Cannot find icon file ${icon}. Reset icon." icon="" fi else - echo "ERROR: Cannot figure out icon. Reset icon." + echo "ERROR: Cannot figure out icon ${icon}. Reset icon." icon="" fi - echo "icon after first check: $icon" + #echo "icon after first check: $icon" # If no icon defined we are trying to search for installed app icon if [[ "$icon" == "" ]]; then appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true) @@ -236,7 +236,7 @@ else appIcon="${appIcon}.icns" fi icon="${appPath}/Contents/Resources/${appIcon}" - echo "Icon before file check: ${icon}" + #echo "Icon before file check: ${icon}" if [ ! -f "${icon}" ]; then # Using LOGO variable to show logo in swiftDialog case $LOGO in diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh index 97a43cb..a1d6d7c 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh @@ -156,24 +156,24 @@ else echo "$item $itemName" #Check icon (expecting beginning with “http” to be web-link and “/” to be disk file) - echo "icon before check: $icon" + #echo "icon before check: $icon" if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then - echo "icon looks to be web-link" + #echo "icon looks to be web-link" if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then - echo "ERROR: Cannot download link. Reset icon." + echo "ERROR: Cannot download ${icon} link. Reset icon." icon="" fi elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then - echo "icon looks to be a file" + #echo "icon looks to be a file" if [[ ! -a "${icon}" ]]; then - echo "ERROR: Cannot find file. Reset icon." + echo "ERROR: Cannot find icon file ${icon}. Reset icon." icon="" fi else - echo "ERROR: Cannot figure out icon. Reset icon." + echo "ERROR: Cannot figure out icon ${icon}. Reset icon." icon="" fi - echo "icon after first check: $icon" + #echo "icon after first check: $icon" # If no icon defined we are trying to search for installed app icon if [[ "$icon" == "" ]]; then appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true) @@ -182,7 +182,7 @@ else appIcon="${appIcon}.icns" fi icon="${appPath}/Contents/Resources/${appIcon}" - echo "Icon before file check: ${icon}" + #echo "Icon before file check: ${icon}" if [ ! -f "${icon}" ]; then # Using LOGO variable to show logo in swiftDialog case $LOGO in diff --git a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh index a08b272..5714f05 100755 --- a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh @@ -140,24 +140,24 @@ else echo "$item $itemName" #Check icon (expecting beginning with “http” to be web-link and “/” to be disk file) - echo "icon before check: $icon" + #echo "icon before check: $icon" if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then - echo "icon looks to be web-link" + #echo "icon looks to be web-link" if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then - echo "ERROR: Cannot download link. Reset icon." + echo "ERROR: Cannot download ${icon} link. Reset icon." icon="" fi elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then - echo "icon looks to be a file" + #echo "icon looks to be a file" if [[ ! -a "${icon}" ]]; then - echo "ERROR: Cannot find file. Reset icon." + echo "ERROR: Cannot find icon file ${icon}. Reset icon." icon="" fi else - echo "ERROR: Cannot figure out icon. Reset icon." + echo "ERROR: Cannot figure out icon ${icon}. Reset icon." icon="" fi - echo "icon after first check: $icon" + #echo "icon after first check: $icon" # If no icon defined we are trying to search for installed app icon if [[ "$icon" == "" ]]; then appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true) @@ -166,7 +166,7 @@ else appIcon="${appIcon}.icns" fi icon="${appPath}/Contents/Resources/${appIcon}" - echo "Icon before file check: ${icon}" + #echo "Icon before file check: ${icon}" if [ ! -f "${icon}" ]; then # Using LOGO variable to show logo in swiftDialog case $LOGO in diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh index 6a114e0..ecbf825 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh @@ -140,24 +140,24 @@ else echo "$item $itemName" #Check icon (expecting beginning with “http” to be web-link and “/” to be disk file) - echo "icon before check: $icon" + #echo "icon before check: $icon" if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then - echo "icon looks to be web-link" + #echo "icon looks to be web-link" if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then - echo "ERROR: Cannot download link. Reset icon." + echo "ERROR: Cannot download ${icon} link. Reset icon." icon="" fi elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then - echo "icon looks to be a file" + #echo "icon looks to be a file" if [[ ! -a "${icon}" ]]; then - echo "ERROR: Cannot find file. Reset icon." + echo "ERROR: Cannot find icon file ${icon}. Reset icon." icon="" fi else - echo "ERROR: Cannot figure out icon. Reset icon." + echo "ERROR: Cannot figure out icon ${icon}. Reset icon." icon="" fi - echo "icon after first check: $icon" + #echo "icon after first check: $icon" # If no icon defined we are trying to search for installed app icon if [[ "$icon" == "" ]]; then appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true) @@ -166,7 +166,7 @@ else appIcon="${appIcon}.icns" fi icon="${appPath}/Contents/Resources/${appIcon}" - echo "Icon before file check: ${icon}" + #echo "Icon before file check: ${icon}" if [ ! -f "${icon}" ]; then # Using LOGO variable to show logo in swiftDialog case $LOGO in diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh index 7d4c231..9f31c1d 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh @@ -137,24 +137,24 @@ else echo "$item $itemName" #Check icon (expecting beginning with “http” to be web-link and “/” to be disk file) - echo "icon before check: $icon" + #echo "icon before check: $icon" if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then - echo "icon looks to be web-link" + #echo "icon looks to be web-link" if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then - echo "ERROR: Cannot download link. Reset icon." + echo "ERROR: Cannot download ${icon} link. Reset icon." icon="" fi elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then - echo "icon looks to be a file" + #echo "icon looks to be a file" if [[ ! -a "${icon}" ]]; then - echo "ERROR: Cannot find file. Reset icon." + echo "ERROR: Cannot find icon file ${icon}. Reset icon." icon="" fi else - echo "ERROR: Cannot figure out icon. Reset icon." + echo "ERROR: Cannot figure out icon ${icon}. Reset icon." icon="" fi - echo "icon after first check: $icon" + #echo "icon after first check: $icon" # If no icon defined we are trying to search for installed app icon if [[ "$icon" == "" ]]; then appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true) @@ -163,7 +163,7 @@ else appIcon="${appIcon}.icns" fi icon="${appPath}/Contents/Resources/${appIcon}" - echo "Icon before file check: ${icon}" + #echo "Icon before file check: ${icon}" if [ ! -f "${icon}" ]; then # Using LOGO variable to show logo in swiftDialog case $LOGO in diff --git a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh index 9bacc2f..fde5e30 100644 --- a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh +++ b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh @@ -140,24 +140,24 @@ else echo "$item $itemName" #Check icon (expecting beginning with “http” to be web-link and “/” to be disk file) - echo "icon before check: $icon" + #echo "icon before check: $icon" if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then - echo "icon looks to be web-link" + #echo "icon looks to be web-link" if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then - echo "ERROR: Cannot download link. Reset icon." + echo "ERROR: Cannot download ${icon} link. Reset icon." icon="" fi elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then - echo "icon looks to be a file" + #echo "icon looks to be a file" if [[ ! -a "${icon}" ]]; then - echo "ERROR: Cannot find file. Reset icon." + echo "ERROR: Cannot find icon file ${icon}. Reset icon." icon="" fi else - echo "ERROR: Cannot figure out icon. Reset icon." + echo "ERROR: Cannot figure out icon ${icon}. Reset icon." icon="" fi - echo "icon after first check: $icon" + #echo "icon after first check: $icon" # If no icon defined we are trying to search for installed app icon if [[ "$icon" == "" ]]; then appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true) @@ -166,7 +166,7 @@ else appIcon="${appIcon}.icns" fi icon="${appPath}/Contents/Resources/${appIcon}" - echo "Icon before file check: ${icon}" + #echo "Icon before file check: ${icon}" if [ ! -f "${icon}" ]; then # Using LOGO variable to show logo in swiftDialog case $LOGO in From 8c853ddd30b4d93c1e677dea77dd64b6ad4fcb0f Mon Sep 17 00:00:00 2001 From: Theile Date: Tue, 15 Nov 2022 11:22:28 +0100 Subject: [PATCH 12/12] GitHub API call is now primary --- MDM/Installomator 1st Auto-install DEPNotify.sh | 11 ++++++----- MDM/Installomator 1st Auto-install.sh | 11 ++++++----- MDM/Installomator 1st SS DEPNotify.sh | 11 ++++++----- MDM/Installomator 1st SS.sh | 11 ++++++----- MDM/Jamf/00_PrepareInstall_SwiftDialog.sh | 8 ++++---- MDM/Progress 1st swiftDialog.sh | 11 ++++++----- MDM/install Installomator direct.sh | 11 ++++++----- MDM/install swiftDialog direct.sh | 11 ++++++----- 8 files changed, 46 insertions(+), 39 deletions(-) diff --git a/MDM/Installomator 1st Auto-install DEPNotify.sh b/MDM/Installomator 1st Auto-install DEPNotify.sh index 7baa737..e357923 100755 --- a/MDM/Installomator 1st Auto-install DEPNotify.sh +++ b/MDM/Installomator 1st Auto-install DEPNotify.sh @@ -54,7 +54,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT." # https://github.com/Installomator/Installomator # ###################################################################### -scriptVersion="9.5" +scriptVersion="9.6" +# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails. # v. 9.5 : 2022-09-21 : change of GitHub download # v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API # v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support. @@ -207,11 +208,11 @@ gitusername="Installomator" gitreponame="Installomator" #printlog "$gitusername $gitreponame" filetype="pkg" -#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" -downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" +downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then - printlog "Trying GitHub API for download URL." - downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + printlog "GitHub API failed, trying failover." + #downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" + downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" fi #printlog "$downloadURL" appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g') diff --git a/MDM/Installomator 1st Auto-install.sh b/MDM/Installomator 1st Auto-install.sh index 6dd9353..6cb382e 100755 --- a/MDM/Installomator 1st Auto-install.sh +++ b/MDM/Installomator 1st Auto-install.sh @@ -52,7 +52,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT." # https://github.com/Installomator/Installomator # ###################################################################### -scriptVersion="9.5" +scriptVersion="9.6" +# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails. # v. 9.5 : 2022-09-21 : change of GitHub download # v. 9.4 : 2022-09-14 : Making error message optional. downloadURL can fall back on GitHub API. # v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support. @@ -178,11 +179,11 @@ gitusername="Installomator" gitreponame="Installomator" #printlog "$gitusername $gitreponame" filetype="pkg" -#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" -downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" +downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then - printlog "Trying GitHub API for download URL." - downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + printlog "GitHub API failed, trying failover." + #downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" + downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" fi #printlog "$downloadURL" appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g') diff --git a/MDM/Installomator 1st SS DEPNotify.sh b/MDM/Installomator 1st SS DEPNotify.sh index b911f79..ac163c4 100755 --- a/MDM/Installomator 1st SS DEPNotify.sh +++ b/MDM/Installomator 1st SS DEPNotify.sh @@ -54,7 +54,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT." # https://github.com/Installomator/Installomator # ###################################################################### -scriptVersion="9.5" +scriptVersion="9.6" +# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails. # v. 9.5 : 2022-09-21 : change of GitHub download # v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API # v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support. @@ -207,11 +208,11 @@ gitusername="Installomator" gitreponame="Installomator" #printlog "$gitusername $gitreponame" filetype="pkg" -#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" -downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" +downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then - printlog "Trying GitHub API for download URL." - downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + printlog "GitHub API failed, trying failover." + #downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" + downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" fi #printlog "$downloadURL" appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g') diff --git a/MDM/Installomator 1st SS.sh b/MDM/Installomator 1st SS.sh index e017831..c21a842 100755 --- a/MDM/Installomator 1st SS.sh +++ b/MDM/Installomator 1st SS.sh @@ -51,7 +51,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT." # https://github.com/Installomator/Installomator # ###################################################################### -scriptVersion="9.5" +scriptVersion="9.6" +# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails. # v. 9.5 : 2022-09-21 : change of GitHub download # v. 9.4 : 2022-09-14 : Making error message optional. downloadURL can fall back on GitHub API. # v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support. @@ -177,11 +178,11 @@ gitusername="Installomator" gitreponame="Installomator" #printlog "$gitusername $gitreponame" filetype="pkg" -#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" -downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" +downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then - printlog "Trying GitHub API for download URL." - downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + printlog "GitHub API failed, trying failover." + #downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" + downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" fi #printlog "$downloadURL" appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g') diff --git a/MDM/Jamf/00_PrepareInstall_SwiftDialog.sh b/MDM/Jamf/00_PrepareInstall_SwiftDialog.sh index 84a1212..e04f4a1 100755 --- a/MDM/Jamf/00_PrepareInstall_SwiftDialog.sh +++ b/MDM/Jamf/00_PrepareInstall_SwiftDialog.sh @@ -54,11 +54,11 @@ gitusername="bartreardon" gitreponame="swiftDialog" #echo "$gitusername $gitreponame" filetype="pkg" -#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" -downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" +downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then - echo "Trying GitHub API for download URL." - downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + printlog "GitHub API failed, trying failover." + #downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" + downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" fi #echo "$downloadURL" appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g') diff --git a/MDM/Progress 1st swiftDialog.sh b/MDM/Progress 1st swiftDialog.sh index 7f7a98e..2428cf7 100755 --- a/MDM/Progress 1st swiftDialog.sh +++ b/MDM/Progress 1st swiftDialog.sh @@ -86,7 +86,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT." # Or fonts, like: # "Apple SF Pro Font,/Library/Fonts/SF-Pro.ttf" ###################################################################### -scriptVersion="9.5" +scriptVersion="9.6" +# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails. # v. 9.5 : 2022-09-21 : change of GitHub download # v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API # v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. @@ -230,11 +231,11 @@ gitusername="bartreardon" gitreponame="swiftDialog" #printlog "$gitusername $gitreponame" filetype="pkg" -#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" -downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" +downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then - printlog "Trying GitHub API for download URL." - downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + printlog "GitHub API failed, trying failover." + #downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" + downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" fi #printlog "$downloadURL" appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g') diff --git a/MDM/install Installomator direct.sh b/MDM/install Installomator direct.sh index 352275e..be57683 100755 --- a/MDM/install Installomator direct.sh +++ b/MDM/install Installomator direct.sh @@ -16,7 +16,8 @@ # https://github.com/Installomator/Installomator # ###################################################################### -scriptVersion="9.5" +scriptVersion="9.6" +# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails. # v. 9.5 : 2022-09-21 : change of GitHub download # v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API # v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. @@ -65,11 +66,11 @@ gitusername="Installomator" gitreponame="Installomator" #printlog "$gitusername $gitreponame" filetype="pkg" -#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" -downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" +downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then - printlog "Trying GitHub API for download URL." - downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + printlog "GitHub API failed, trying failover." + #downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" + downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" fi #printlog "$downloadURL" appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g') diff --git a/MDM/install swiftDialog direct.sh b/MDM/install swiftDialog direct.sh index d318b2f..0c11674 100755 --- a/MDM/install swiftDialog direct.sh +++ b/MDM/install swiftDialog direct.sh @@ -16,7 +16,8 @@ # https://github.com/Installomator/Installomator # ###################################################################### -scriptVersion="9.5" +scriptVersion="9.6" +# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails. # v. 9.5 : 2022-09-21 : change of GitHub download # v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API. # v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. @@ -65,11 +66,11 @@ gitusername="bartreardon" gitreponame="swiftDialog" #printlog "$gitusername $gitreponame" filetype="pkg" -#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" -downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" +downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then - printlog "Trying GitHub API for download URL." - downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + printlog "GitHub API failed, trying failover." + #downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" + downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)" fi #printlog "$downloadURL" appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')