Skip to content

Commit

Permalink
Update Setup-Your-Mac-via-Dialog.bash
Browse files Browse the repository at this point in the history
Adding Pre-Flight check for supportTeamName & at least one of the supportTeam Variables filled in
  • Loading branch information
GadgetGeekNI authored Sep 15, 2023
1 parent 1db034a commit 407ef94
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Setup-Your-Mac-via-Dialog.bash
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ brandingIconDark="https://cdn-icons-png.flaticon.com/512/740/740878.png"

# IT Support Variables - Use these if the default text is fine but you want your org's info inserted instead
supportTeamName="Help Desk"
supportTeamPhone="+1 (801) 555-1212"
supportTeamEmail="RescueMe@domain.com"
supportKB="KB8675309"
supportTeamPhone=""
supportTeamEmail="rescueme@domain.com"
supportKB="KB86753099"
supportTeamErrorKB=", and mention [${supportKB}](https://servicenow.company.com/support?id=kb_article_view&sysparm_article=${supportKB}#Failures)"
supportTeamHelpKB="\n- **Knowledge Base Article:** ${supportKB}"

Expand Down Expand Up @@ -295,6 +295,20 @@ done
updateScriptLog "PRE-FLIGHT CHECK: Finder & Dock are running; proceeding …"


# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Pre-flight Check: Validate at least one support variable is populated
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Check if supportTeamName is populated
if [[ -z $supportTeamName ]]; then
updateScriptLog "PRE-FLIGHT CHECK: SupportTeamName must be populated to proceed; exiting"
exit 1
fi

if [[ -z $supportTeamPhone && -z $supportTeamEmail && -z $supportKB ]]; then
updateScriptLog "PRE-FLIGHT CHECK: At least one SupportTeam variable must be populated to proceed; exiting"
exit 1
fi

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Pre-flight Check: Validate Logged-in System Accounts
Expand Down

0 comments on commit 407ef94

Please sign in to comment.