-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathMicrosoft Office 365.bash
executable file
·89 lines (69 loc) · 3.34 KB
/
Microsoft Office 365.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
#####################################################################################
#
# Microsoft Office 365
# for
# Setup Your Mac via swiftDialog
#
####################################################################################
#
# HISTORY
#
# Version 0.0.3, 25-Apr-2023, Andrew Clark (@drtaru)
# - Changed Success result to Success to map to new SYM validation status
#
####################################################################################
# A script to collect the installation status of Microsoft Office 365. #
# #
# If an expected app is NOT installed, the `appChecks` variable will include the #
# keyword "NOT", and the script will report a failure. #
# #
# If all expected apps are installed, the `RESULT` variable will include the #
# keyword "Success"; see the following post: #
# https://snelson.us/2023/01/setup-your-mac-validation/ #
####################################################################################
####################################################################################################
#
# Global Variables
#
####################################################################################################
# Set Apps to check, valid options are: "Microsoft Excel" "Microsoft OneNote" "Microsoft Outlook" "Microsoft PowerPoint" "Microsoft Word" "OneDrive"
appsToCheck=("Microsoft Excel" "Microsoft OneNote" "Microsoft Outlook" "Microsoft PowerPoint" "Microsoft Word" "OneDrive")
appChecks=""
RESULT=""
IFS=""
####################################################################################################
#
# Functions
#
####################################################################################################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Check for an app's Info.plist
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
function appCheck() {
app="${1}"
if [[ -f "/Applications/${app}.app/Contents/Info.plist" ]]; then
appChecks+="${app} installed; "
else
appChecks+="${app} NOT installed; "
fi
}
####################################################################################################
#
# Program
#
####################################################################################################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Check for Microsoft Office 365 apps (i.e., Microsoft_365_and_Office_16.70.23021201_Installer.pkg)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
for app in ${appsToCheck[@]}; do
appCheck "$app"
done
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Output Results
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
case "${appChecks}" in
*"NOT"* ) RESULT="Failure: ${appChecks}" ;;
* ) RESULT="Success: ${appChecks}" ;;
esac
/bin/echo "<result>${RESULT}</result>"