Skip to content

Commit

Permalink
1.16.0-b3
Browse files Browse the repository at this point in the history
Signed-off-by: Dan K. Snelson <[email protected]>
  • Loading branch information
dan-snelson committed Sep 13, 2024
1 parent e1251b1 commit f21c4c5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# CHANGELOG

## 1.16.0
### 29-Jul-2024
### 13-Sep-2024
- Added proof-of-concept validations for swiftDialog `2.5.1`'s "blurscreen" control
- Removed vendor-specific Local Validations (in favor of Remote Validations)
- Updated Configuration `policyJSON` to better match internal usage
- Updated Configuration `policyJSON` to better match internal usage
- Added "activate" command to Validations

## 1.15.0
### 11-Jun-2024
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- markdownlint-disable-next-line first-line-heading no-inline-html -->
[<img align="left" alt="Setup Your Mac (1.14.0)" src="images/SYM_icon.png" width="128" />](https://snelson.us/sym)
[<img align="left" alt="Setup Your Mac (1.16.0)" src="images/SYM_icon.png" width="128" />](https://snelson.us/sym)

# Setup Your Mac (1.16.0) with SYM-Helper (1.2.0) via swiftDialog (2.5.1)
# Setup Your Mac (1.16.0) with SYM-Helper (1.2.0) via swiftDialog (2.5.2)

![GitHub release (latest by date)](https://img.shields.io/github/v/release/dan-snelson/Setup-Your-Mac?display_name=tag) ![GitHub issues](https://img.shields.io/github/issues-raw/dan-snelson/Setup-Your-Mac) ![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/dan-snelson/Setup-Your-Mac) ![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/dan-snelson/Setup-Your-Mac) ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/dan-snelson/Setup-Your-Mac)

> Optimized to leverage SYM-Helper (1.2.0), Setup Your Mac (1.16.0) leverages new features of swiftDialog (2.5.1)
> Optimized to leverage SYM-Helper (1.2.0), Setup Your Mac (1.16.0) leverages new features of swiftDialog (2.5.2)
[<img alt="Setup Your Mac (1.15.0)" src="images/SYM-Helper_1.2.0_SYM-1.15.0_Hero.png" />](https://snelson.us/sym)

Expand Down
22 changes: 13 additions & 9 deletions Setup-Your-Mac-via-Dialog.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#
# HISTORY
#
# Version 1.16.0, 29-Jul-2024
# Version 1.16.0, 13-Sep-2024
# - Added proof-of-concept validations for swiftDialog `2.5.1`'s "blurscreen" control
# - Removed vendor-specific Local Validations (in favor of Remote Validations)
# - Updated Configuration `policyJSON` to better match internal usage
# - Updated Configuration `policyJSON` to better match internal usage
# - Added "activate" command to Validations
#
####################################################################################################

Expand All @@ -29,7 +30,7 @@
# Script Version and Jamf Pro Script Parameters
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

scriptVersion="1.16.0-b2"
scriptVersion="1.16.0-b3"
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
scriptLog="${4:-"/var/log/org.churchofjesuschrist.log"}" # Parameter 4: Script Log Location [ /var/log/org.churchofjesuschrist.log ] (i.e., Your organization's default location for client-side logs)
debugMode="${5:-"verbose"}" # Parameter 5: Debug Mode [ verbose (default) | true | false ]
Expand All @@ -39,7 +40,7 @@ requiredMinimumBuild="${8:-"disabled"}"
outdatedOsAction="${9:-"/System/Library/CoreServices/Software Update.app"}" # Parameter 9: Outdated OS Action [ /System/Library/CoreServices/Software Update.app (default) | jamfselfservice://content?entity=policy&id=117&action=view ] (i.e., Jamf Pro Self Service policy ID for operating system ugprades)
webhookURL="${10:-""}" # Parameter 10: Microsoft Teams or Slack Webhook URL [ Leave blank to disable (default) | https://microsoftTeams.webhook.com/URL | https://hooks.slack.com/services/URL ] Can be used to send a success or failure message to Microsoft Teams or Slack via Webhook. (Function will automatically detect if Webhook URL is for Slack or Teams; can be modified to include other communication tools that support functionality.)
presetConfiguration="${11:-""}" # Parameter 11: Specify a Configuration (i.e., `policyJSON`; NOTE: If set, `promptForConfiguration` will be automatically suppressed and the preselected configuration will be used instead)
swiftDialogMinimumRequiredVersion="2.5.1.4770" # This will be set and updated as dependancies on newer features change.
swiftDialogMinimumRequiredVersion="2.5.2.4777" # This will be set and updated as dependancies on newer features change.



Expand Down Expand Up @@ -633,6 +634,7 @@ function validatePolicyResult() {
rosetta )
updateSetupYourMacDialog "Locally Validate Policy Result: Rosetta 2 … " # Thanks, @smithjw!
dialogUpdateSetupYourMac "listitem: index: $i, status: wait, statustext: Checking …"
dialogUpdateSetupYourMac "activate:"
arch=$( /usr/bin/arch )
if [[ "${arch}" == "arm64" ]]; then
# Mac with Apple silicon; check for Rosetta
Expand All @@ -658,6 +660,7 @@ function validatePolicyResult() {
filevault )
updateSetupYourMacDialog "Locally Validate Policy Result: Validate FileVault … "
dialogUpdateSetupYourMac "listitem: index: $i, status: wait, statustext: Checking …"
dialogUpdateSetupYourMac "activate:"
updateSetupYourMacDialog "Validate Policy Result: Pausing for 5 seconds for FileVault … "
sleep 5 # Arbitrary value; tuning needed
fileVaultCheck=$( fdesetup isactive )
Expand Down Expand Up @@ -713,6 +716,7 @@ function validatePolicyResult() {
else
updateSetupYourMacDialog "Remotely Validate '${trigger}' '${validation}'"
dialogUpdateSetupYourMac "listitem: index: $i, status: wait, statustext: Checking …"
dialogUpdateSetupYourMac "activate:"
result=$( "${jamfBinary}" policy -event "${trigger}" | grep "Script result:" )
if [[ "${result}" == *"Failed"* ]]; then
dialogUpdateSetupYourMac "listitem: index: $i, status: fail, statustext: Failed"
Expand Down Expand Up @@ -1810,7 +1814,7 @@ failureCommandFile=$( mktemp -u /var/tmp/dialogCommandFileFailure.XXX )

welcomeTitle="Happy $( date +'%A' ), ${loggedInUserFirstname}! \nWelcome to your new ${modelName}"

welcomeMessage="Please enter the **required** information for your ${modelName}, select your preferred **Configuration** then click **Continue** to start applying settings to your new Mac. \n\nOnce completed, the **Wait** button will be enabled and you‘ll be able to review the results before restarting your ${modelName}."
welcomeMessage="Please enter the **required** information for your ${modelName}, select your preferred **Configuration** then click **Continue** to start applying settings to your new Mac. \n\nOnce completed, the **Wait** button will be enabled and you‘ll be able to review the results before restarting your ${modelName}."

if [[ -n "${supportTeamName}" ]]; then

Expand Down Expand Up @@ -3213,8 +3217,8 @@ elif [[ "${welcomeDialog}" == "userInput" ]]; then
welcomeDialog "Waiting to display 'Setup Your Mac' dialog; pausing"
sleep 0.5
done
welcomeDialog "'Setup Your Mac' dialog displayed; ensure it's the front-most app"
runAsUser osascript -e 'tell application "Dialog" to activate'
updateSetupYourMacDialog "'Setup Your Mac' dialog displayed; ensure it's the front-most app"
dialogUpdateSetupYourMac "activate:"
if [[ -n "${overlayoverride}" ]]; then
dialogUpdateSetupYourMac "overlayicon: ${overlayoverride}"
fi
Expand Down Expand Up @@ -3271,8 +3275,8 @@ else
welcomeDialog "Waiting to display 'Setup Your Mac' dialog; pausing"
sleep 0.5
done
welcomeDialog "'Setup Your Mac' dialog displayed; ensure it's the front-most app"
runAsUser osascript -e 'tell application "Dialog" to activate'
updateSetupYourMacDialog "'Setup Your Mac' dialog displayed; ensure it's the front-most app"
dialogUpdateSetupYourMac "activate:"
if [[ -n "${overlayoverride}" ]]; then
dialogUpdateSetupYourMac "overlayicon: ${overlayoverride}"
fi
Expand Down

0 comments on commit f21c4c5

Please sign in to comment.