From 784872f2e59fa8b3ca35fec533206403630e5358 Mon Sep 17 00:00:00 2001 From: Graham Pugh Date: Tue, 13 Jan 2026 10:54:01 +0100 Subject: [PATCH 1/4] tested fixes for each dialog --- services/Framework-Fixer/Framework-Fixer.sh | 143 +++++++++++--------- 1 file changed, 77 insertions(+), 66 deletions(-) mode change 100644 => 100755 services/Framework-Fixer/Framework-Fixer.sh diff --git a/services/Framework-Fixer/Framework-Fixer.sh b/services/Framework-Fixer/Framework-Fixer.sh old mode 100644 new mode 100755 index 2a85b88..70a03c8 --- a/services/Framework-Fixer/Framework-Fixer.sh +++ b/services/Framework-Fixer/Framework-Fixer.sh @@ -48,7 +48,7 @@ $( date '+%Y-%m-%d %H:%M:%S') INFO: Checking if swiftDialog is installed" >> "${log_file}" if [[ -e "${dialog_path}" ]] then - echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: swiftDialog i=s already installed" >> "${log_file}" + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: swiftDialog is already installed" >> "${log_file}" else echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: swiftDialog not installed! Please install swiftDialog." >> "${log_file}" osascript <<'EOF' @@ -105,7 +105,7 @@ auth_method_prompt() { --title "Framework Fixer" \ --message 'Welcome! - Please select a method to authenticate to Jamf Pro. Click on "Required Privileges" for more information.' \ +Please select a method to authenticate to Jamf Pro. Click on "Required Privileges" for more information.' \ --radio \ --selecttitle "Please select an option",radio \ --selectvalues "User Account & Password, API Client & Secret" \ @@ -123,7 +123,7 @@ auth_method_prompt() { invalidate_token exit 0 fi - auth_selection=$(echo "${auth_method}" | awk -F '"' '{print $4}') + auth_selection=$(echo "${auth_method}" | grep "\"Please select an option\" : " | awk -F '"' '{print $4}') if [[ ${auth_selection} == "User Account & Password" ]] then echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Selected authentication method: User Account & Password" >> "${log_file}" @@ -141,7 +141,7 @@ auth_method_prompt() { # Prompt for User Account and Password credential_prompt() { echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Prompting for credentials and server URL" >> "${log_file}" - if ! server_details=$( + if server_details=$( "${dialog_path}" \ --title "Framework Fixer" \ --message "Please enter your Jamf Pro details below:" \ @@ -157,9 +157,9 @@ credential_prompt() { --json ) then - jamf_pro_url=$(echo "${server_details}" | ${plutil_path} -extract "Jamf Pro URL" xml1 -o - - | xmllint --xpath "string(//string)" -) - username=$(echo "${server_details}" | ${plutil_path} -extract "${username_label}" xml1 -o - - | xmllint --xpath "string(//string)" -) - api_password=$(echo "${server_details}" | ${plutil_path} -extract "${password_label}" xml1 -o - - | xmllint --xpath "string(//string)" -) + jamf_pro_url=$(echo "${server_details}" | "${plutil_path}" -extract "Jamf Pro URL" xml1 -o - - | xmllint --xpath "string(//string)" -) + username=$(echo "${server_details}" | "${plutil_path}" -extract "${username_label}" xml1 -o - - | xmllint --xpath "string(//string)" -) + api_password=$(echo "${server_details}" | "${plutil_path}" -extract "${password_label}" xml1 -o - - | xmllint --xpath "string(//string)" -) else echo "$(date '+%Y-%m-%d %H:%M:%S') WARNING: User Cancelled" >> "${log_file}" exit 0 @@ -187,7 +187,7 @@ invalid_credentials_prompt() { # Prompt to choose new or existing group group_option_prompt() { echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Prompting to choose between new group or existing group" >> "${log_file}" - if ! group_options=$( + if group_options=$( "${dialog_path}" \ --title "Framework Fixer" \ --message "Would you like to create a Smart Computer Group to redeploy the Jamf Management Framework to?" \ @@ -202,12 +202,13 @@ group_option_prompt() { --small ) then - group_selection=$(echo "${group_options}" | awk -F '"' '{print $4}') + group_selection=$(echo "${group_options}" | grep "\"Please select an option\" : " | awk -F '"' '{print $4}') else echo "$(date '+%Y-%m-%d %H:%M:%S') WARNING: User Cancelled" >> "${log_file}" invalidate_token exit 0 fi + if [[ "${group_selection}" == "Please create a Smart Computer Group" ]] then # Prompt for number of days since last Inventory Update @@ -235,7 +236,7 @@ group_name_prompt() { error_prompt fi # Convert JSON to XML plist for xpath parsing - plist_data=$(echo "${raw_JSON}" | ${plutil_path} -convert xml1 -o - - 2>/dev/null) + plist_data=$(echo "${raw_JSON}" | "${plutil_path}" -convert xml1 -o - - 2>/dev/null) # Check if plist contains data if [[ -z ${plist_data} ]] then @@ -258,7 +259,7 @@ group_name_prompt() { # Prompt user to select a Smart Computer Group from the list echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Prompting to choose a Smart Computer Group" >> "${log_file}" - if ! group_name=$( + if group_name=$( "${dialog_path}" \ --title "Framework Fixer" \ --message "Choose a Smart Computer Group from the list:" \ @@ -275,7 +276,7 @@ group_name_prompt() { --json ) then - group_name=$(echo "${group_name}" | ${plutil_path} -extract SelectedOption raw -o - - 2>/dev/null) + group_name=$(echo "${group_name}" | "${plutil_path}" -extract SelectedOption raw -o - - 2>/dev/null) # Replace spaces with %20 for API call group_name2=${group_name// /%20} else @@ -302,7 +303,7 @@ group_exists() { # Prompt for number of days since last Inventory Update days_prompt() { - if ! days=$( + if days=$( "${dialog_path}" \ --title "Framework Fixer" \ --message "OK, we will create a Smart Computer Group based on the number of days since the last Inventory Update. Please enter the number of days." \ @@ -317,7 +318,7 @@ days_prompt() { --json ) then - days=$(echo "$days" | awk -F '"' '{print $4}') + days=$(echo "$days" | grep "\"Number of days\" : " | awk -F '"' '{print $4}') new_group_prompt else echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: User clicked on 'Back'" >> "${log_file}" @@ -328,7 +329,7 @@ days_prompt() { # Request the name of the Smart Computer Group to be created new_group_prompt() { echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Requesting the name for the new Smart Computer Group" >> "${log_file}" - if ! group_name=$( + if group_name=$( "${dialog_path}" \ --title "Framework Fixer" \ --message "Please enter a name for the new Smart Computer Group." \ @@ -342,7 +343,7 @@ new_group_prompt() { --json ) then - group_name=$(echo "${group_name}" | ${plutil_path} -extract "Group Name" xml1 -o - - | xmllint --xpath "string(//string)" -) + group_name=$(echo "${group_name}" | "${plutil_path}" -extract "Group Name" xml1 -o - - | xmllint --xpath "string(//string)" -) # Replace spaces with %20 for API call group_name2=${group_name// /%20} else @@ -434,7 +435,8 @@ redeployment_prompt() { --messagefont "${message_font}" \ --titlefont "${title_font}" \ --button1text "Cancel" \ - --progress --indeterminate \ + --progress \ + --indeterminate \ --commandfile "${command_file}" & then echo "$(date '+%Y-%m-%d %H:%M:%S') WARNING: User Cancelled" >> "${log_file}" @@ -463,23 +465,22 @@ create_group() { } EOM -# Create the Smart Computer Group -echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Creating group called ${group_name}" >> "${log_file}" - -group_creation=$(check_response -X 'POST' "${jamf_pro_url}/api/v2/computer-groups/smart-groups" -H "accept: application/json" -H "Authorization: Bearer ${bearer_token}" -H "Content-Type: application/json" -d "${json_payload}" -b "${ap_balance_id}") -if [[ $group_creation =~ ^(200|201|202|204)$ ]] -then - echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Group called ${group_name} successfully created" >> "${log_file}" -else - echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Group creation failed" >> "${log_file}" - error_prompt - invalidate_token - exit 1 -fi + # Create the Smart Computer Group + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Creating group called ${group_name}" >> "${log_file}" + group_creation=$(check_response -X 'POST' "${jamf_pro_url}/api/v2/computer-groups/smart-groups" -H "accept: application/json" -H "Authorization: Bearer ${bearer_token}" -H "Content-Type: application/json" -d "${json_payload}" -b "${ap_balance_id}") + if [[ $group_creation =~ ^(200|201|202|204)$ ]] + then + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Group called ${group_name} successfully created" >> "${log_file}" + else + echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Group creation failed" >> "${log_file}" + error_prompt + invalidate_token + exit 1 + fi } error_prompt() { - if ! "${dialog_path}" \ + if "${dialog_path}" \ --title "Framework Fixer" \ --message "Oops! An error occurred. Please check ${log_file} for more details" \ --icon "${icon}" \ @@ -501,7 +502,7 @@ done_prompt() { --title "Framework Fixer" \ --message "We're done! - The command to redeploy the Jamf Management Framework has been sent to all members of the Smart Computer Group." \ +The command to redeploy the Jamf Management Framework has been sent to all members of the Smart Computer Group." \ --icon "${icon}" \ --alignment "left" \ --small \ @@ -520,9 +521,18 @@ token_expiration_epoch="0" get_bearer_token() { if [[ ${auth_method} == "user_creds" ]] then - response=$("${curl_path}" -s -u "${username}":"${api_password}" "${jamf_pro_url}"/api/v1/auth/token -X POST) - bearer_token=$(echo "${response}" | ${plutil_path} -extract token raw -) - token_expiration=$(echo "${response}" | ${plutil_path} -extract expires raw - | awk -F . '{print $1}') + response=$("${curl_path}" -s -u "${username}:${api_password}" "${jamf_pro_url}"/api/v1/auth/token -X POST) + bearer_token=$(echo "${response}" | "${plutil_path}" -extract token raw - 2>/dev/null) + # check token value was retrieved + if [[ -z "${bearer_token}" ]] + then + echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unable to retrieve bearer token" >> "${log_file}" + invalid_credentials_prompt + credential_prompt + get_bearer_token + return + fi + token_expiration=$(echo "${response}" | "${plutil_path}" -extract expires raw - 2>/dev/null | awk -F . '{print $1}') token_expiration_epoch=$(date -j -f "%Y-%m-%dT%T" "${token_expiration}" +"%s") check_token_expiration_prompt fi @@ -534,8 +544,8 @@ get_bearer_token() { --data-urlencode "client_id=${username}" \ --data-urlencode "grant_type=client_credentials" \ --data-urlencode "client_secret=${api_password}") - bearer_token=$(echo "${response}" | ${plutil_path} -extract access_token raw -) - token_expiration=$(echo "${response}" | ${plutil_path} -extract expires_in raw -) + bearer_token=$(echo "${response}" | "${plutil_path}" -extract access_token raw -) + token_expiration=$(echo "${response}" | "${plutil_path}" -extract expires_in raw -) now_epoch_utc=$(date -j -f "%Y-%m-%dT%T" "$(date -u +"%Y-%m-%dT%T")" +"%s") token_expiration_epoch=$((now_epoch_utc + token_expiration - 1)) check_token_expiration_prompt @@ -546,42 +556,43 @@ get_bearer_token() { } check_token_expiration_prompt() { -now_epoch_utc=$(date -j -f "%Y-%m-%dT%T" "$(date -u +"%Y-%m-%dT%T")" +"%s") -if [[ $token_expiration_epoch -gt $now_epoch_utc ]] -then - echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Token valid until the following epoch time: " "${token_expiration_epoch}" >> "${log_file}" -else - echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unable to validate server details/credentials" >> "${log_file}" - invalid_credentials_prompt - credential_prompt - get_bearer_token + now_epoch_utc=$(date -j -f "%Y-%m-%dT%T" "$(date -u +"%Y-%m-%dT%T")" +"%s") + + if [[ -n "$token_expiration_epoch" && ($token_expiration_epoch -gt $now_epoch_utc) ]] + then + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Token valid until the following epoch time: " "${token_expiration_epoch}" >> "${log_file}" + else + echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unable to validate server details/credentials" >> "${log_file}" + invalid_credentials_prompt + credential_prompt + get_bearer_token fi } check_token_expiration() { -now_epoch_utc=$(date -j -f "%Y-%m-%dT%T" "$(date -u +"%Y-%m-%dT%T")" +"%s") -if [[ $token_expiration_epoch -gt $now_epoch_utc ]] -then - echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Token valid until the following epoch time: " "${token_expiration_epoch}" >> "${log_file}" -else - echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: No token available. Getting new token." >> "${log_file}" - get_bearer_token -fi + now_epoch_utc=$(date -j -f "%Y-%m-%dT%T" "$(date -u +"%Y-%m-%dT%T")" +"%s") + if [[ $token_expiration_epoch -gt $now_epoch_utc ]] + then + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Token valid until the following epoch time: " "${token_expiration_epoch}" >> "${log_file}" + else + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: No token available. Getting new token." >> "${log_file}" + get_bearer_token + fi } invalidate_token() { -response_code=$("${curl_path}" -w "%{http_code}" -H "Authorization: Bearer ${bearer_token}" "${jamf_pro_url}/api/v1/auth/invalidate-token" -X POST -s -o /dev/null) -if [[ ${response_code} == 204 ]] -then - echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Token successfully invalidated" >> "${log_file}" - bearer_token="" - token_expiration_epoch="0" -elif [[ ${response_code} == 401 ]] -then - echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Token already invalid" >> "${log_file}" -else - echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: An unknown error occurred invalidating the token" >> "${log_file}" -fi + response_code=$("${curl_path}" -w "%{http_code}" -H "Authorization: Bearer ${bearer_token}" "${jamf_pro_url}/api/v1/auth/invalidate-token" -X POST -s -o /dev/null) + if [[ ${response_code} == 204 ]] + then + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Token successfully invalidated" >> "${log_file}" + bearer_token="" + token_expiration_epoch="0" + elif [[ ${response_code} == 401 ]] + then + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Token already invalid" >> "${log_file}" + else + echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: An unknown error occurred invalidating the token" >> "${log_file}" + fi } ####################################################################################################### From 20bad066a79416f88816ec83c04543d755adb9e0 Mon Sep 17 00:00:00 2001 From: Graham Pugh Date: Tue, 13 Jan 2026 11:09:25 +0100 Subject: [PATCH 2/4] remove special characters --- services/Framework-Fixer/Framework-Fixer.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/services/Framework-Fixer/Framework-Fixer.sh b/services/Framework-Fixer/Framework-Fixer.sh index fd66bdf..7571201 100755 --- a/services/Framework-Fixer/Framework-Fixer.sh +++ b/services/Framework-Fixer/Framework-Fixer.sh @@ -82,11 +82,11 @@ check_response() { echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Command failed with HTTP error ${http_code}" >> "${log_file}" case "${http_code}" in 400) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Bad Request" >> "${log_file}" ;; - 401) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unauthorized – check your credentials." >> "${log_file}" ;; - 403) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Forbidden – Insufficient privileges." >> "${log_file}" ;; - 404) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Not Found – resource does not exist." >> "${log_file}" ;; - 409) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Conflict – resource may already exist." >> "${log_file}" ;; - 500) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Server Error – try again later." >> "${log_file}" ;; + 401) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unauthorized - check your credentials." >> "${log_file}" ;; + 403) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Forbidden - Insufficient privileges." >> "${log_file}" ;; + 404) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Not Found - resource does not exist." >> "${log_file}" ;; + 409) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Conflict - resource may already exist." >> "${log_file}" ;; + 500) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Server Error - try again later." >> "${log_file}" ;; *) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unexpected HTTP response: ${http_code}" >> "${log_file}" ;; esac fi @@ -654,4 +654,3 @@ fi echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Done!" >> "${log_file}" done_prompt fi -exit 0 From 6d4eeb3cf38d35f96a5f16a9d3f45ea9b9d7cca4 Mon Sep 17 00:00:00 2001 From: Graham Pugh Date: Tue, 13 Jan 2026 11:14:31 +0100 Subject: [PATCH 3/4] working fixes --- services/Framework-Fixer/Framework-Fixer.sh | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/services/Framework-Fixer/Framework-Fixer.sh b/services/Framework-Fixer/Framework-Fixer.sh index 7571201..5abdba4 100755 --- a/services/Framework-Fixer/Framework-Fixer.sh +++ b/services/Framework-Fixer/Framework-Fixer.sh @@ -77,18 +77,18 @@ check_response() { if [[ "${http_code}" =~ ^(200|201|202|204)$ ]] then - echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Command successfully sent: HTTP code: ${http_code}" >> "${log_file}" + echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Command successfully sent: HTTP code: ${http_code}" >> "${log_file}" else - echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Command failed with HTTP error ${http_code}" >> "${log_file}" - case "${http_code}" in - 400) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Bad Request" >> "${log_file}" ;; - 401) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unauthorized - check your credentials." >> "${log_file}" ;; - 403) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Forbidden - Insufficient privileges." >> "${log_file}" ;; - 404) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Not Found - resource does not exist." >> "${log_file}" ;; - 409) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Conflict - resource may already exist." >> "${log_file}" ;; - 500) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Server Error - try again later." >> "${log_file}" ;; - *) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unexpected HTTP response: ${http_code}" >> "${log_file}" ;; - esac + echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Command failed with HTTP error ${http_code}" >> "${log_file}" + case "${http_code}" in + 400) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Bad Request" >> "${log_file}" ;; + 401) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unauthorized - check your credentials." >> "${log_file}" ;; + 403) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Forbidden - Insufficient privileges." >> "${log_file}" ;; + 404) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Not Found - resource does not exist." >> "${log_file}" ;; + 409) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Conflict - resource may already exist." >> "${log_file}" ;; + 500) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Server Error - try again later." >> "${log_file}" ;; + *) echo "$(date '+%Y-%m-%d %H:%M:%S') ERROR: Unexpected HTTP response: ${http_code}" >> "${log_file}" ;; + esac fi echo "${http_code}" } From 42210c0dac6c3b6f7ca6154729d23636d54749b5 Mon Sep 17 00:00:00 2001 From: Graham Pugh Date: Tue, 13 Jan 2026 11:37:55 +0100 Subject: [PATCH 4/4] reapplying some changes that got reverted by upstream merge --- services/Framework-Fixer/Framework-Fixer.sh | 76 +++++++++++---------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/services/Framework-Fixer/Framework-Fixer.sh b/services/Framework-Fixer/Framework-Fixer.sh index 5abdba4..7dbc61f 100755 --- a/services/Framework-Fixer/Framework-Fixer.sh +++ b/services/Framework-Fixer/Framework-Fixer.sh @@ -174,15 +174,15 @@ credential_prompt() { # Prompt explaining there was an issue with the server details/credentials invalid_credentials_prompt() { "${dialog_path}" \ - --title "Framework Fixer" \ - --message "Oops! We were unable to validate the provided URL or credentials. Please make sure that the server is reachable and that the server URL and credentials are correct." \ - --icon "${icon}" \ - --overlayicon "caution" \ - --alignment "left" \ - --small \ - --messagefont "${message_font}" \ - --titlefont "${title_font}" \ - --button1text "OK" + --title "Framework Fixer" \ + --message "Oops! We were unable to validate the provided URL or credentials. Please make sure that the server is reachable and that the server URL and credentials are correct." \ + --icon "${icon}" \ + --overlayicon "caution" \ + --alignment "left" \ + --small \ + --messagefont "${message_font}" \ + --titlefont "${title_font}" \ + --button1text "OK" } # Prompt to choose new or existing group @@ -289,15 +289,15 @@ group_name_prompt() { # Prompt explaining a group with the provided name already exists group_exists() { "${dialog_path}" \ - --title "Framework Fixer" \ - --message "Oops! It looks like there is already a Smart Computer Group called ${group_name}" \ - --icon "${icon}" \ - --overlayicon "caution" \ - --alignment "left" \ - --small \ - --messagefont "${message_font}" \ - --titlefont "${title_font}" \ - --button1text "OK" + --title "Framework Fixer" \ + --message "Oops! It looks like there is already a Smart Computer Group called ${group_name}" \ + --icon "${icon}" \ + --overlayicon "caution" \ + --alignment "left" \ + --small \ + --messagefont "${message_font}" \ + --titlefont "${title_font}" \ + --button1text "OK" new_group_prompt } @@ -381,14 +381,14 @@ new_group_prompt() { # Prompt to indicate there are no members in the Smart Computer Group no_members_prompt() { "${dialog_path}" \ - --title "Framework Fixer" \ - --message "There are 0 members in this Smart Computer Group. No action required." \ - --icon "${icon}" \ - --alignment "left" \ - --small \ - --messagefont "${message_font}" \ - --titlefont "${title_font}" \ - --button1text "OK" + --title "Framework Fixer" \ + --message "There are 0 members in this Smart Computer Group. No action required." \ + --icon "${icon}" \ + --alignment "left" \ + --small \ + --messagefont "${message_font}" \ + --titlefont "${title_font}" \ + --button1text "OK" if [[ $? != 0 ]] then echo "$(date '+%Y-%m-%d %H:%M:%S') WARNING: User Cancelled" >> "${log_file}" @@ -400,17 +400,19 @@ no_members_prompt() { # Show number of devices in the Smart Computer Group and ask if we should remediate remediation_prompt() { - remediation_check=$("${dialog_path}" \ - --title "Framework Fixer" \ - --message "There are ${member_count} members in the Smart Computer Group. Would you like to redeploy the Jamf Management Framework on all computers in this group?" \ - --icon "${icon}" \ - --alignment "left" \ - --small \ - --button1text "No" \ - --button2text "Yes" \ - --messagefont "${message_font}" \ - --titlefont "${title_font}" \ - --json) + remediation_check=$( + "${dialog_path}" \ + --title "Framework Fixer" \ + --message "There are ${member_count} members in the Smart Computer Group. Would you like to redeploy the Jamf Management Framework on all computers in this group?" \ + --icon "${icon}" \ + --alignment "left" \ + --small \ + --button1text "No" \ + --button2text "Yes" \ + --messagefont "${message_font}" \ + --titlefont "${title_font}" \ + --json + ) if [[ $? == 2 ]] then echo "$(date '+%Y-%m-%d %H:%M:%S') INFO: Remediation choice: yes" >> "${log_file}"