Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay validation of M365 apps if MAU is running/patching #152

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Validations/Microsoft Office 365.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#
# Version 0.0.3, 25-Apr-2023, Andrew Clark (@drtaru)
# - Changed Success result to Success to map to new SYM validation status
# Version 0.0.4 - 13-Jun-2024, Lewis B (@master-vodawagner)
# - Added ability to delay whilst Microsoft AutoUpdater is running/patching apps
#
####################################################################################
# A script to collect the installation status of Microsoft Office 365. #
Expand Down Expand Up @@ -50,6 +52,7 @@ IFS=""
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

function appCheck() {

app="${1}"
if [[ -f "/Applications/${app}.app/Contents/Info.plist" ]]; then
appChecks+="${app} installed; "
Expand All @@ -71,6 +74,12 @@ function appCheck() {
# Check for Microsoft Office 365 apps (i.e., Microsoft_365_and_Office_16.70.23021201_Installer.pkg)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

#Allow Microsoft AutoUpdater to scan/patch apps before validating install
while pgrep -a "Microsoft AutoUpdate"; do
echo "Microsoft AutoUpdater is still running; pausing for 10 seconds"
sleep 10
done

for app in ${appsToCheck[@]}; do
appCheck "$app"
done
Expand All @@ -86,4 +95,4 @@ case "${appChecks}" in
* ) RESULT="Success: ${appChecks}" ;;
esac

/bin/echo "<result>${RESULT}</result>"
/bin/echo "<result>${RESULT}</result>"