benwhitis / Jamf_Conditional_Access

Resources and documents for the Jamf Pro/Azure AD Conditional Access integration
MIT License
50 stars 5 forks source link

248: = not found #2

Closed swolosin closed 6 months ago

swolosin commented 7 months ago

Upon executing version 2.0.1 of the User Registration Prompt.zsh, the logs display the following output.

###
# AAD User Registration Prompt (2.0.1)
###

2024-02-02 17:05:20 - PRE-FLIGHT CHECK: Initiating …
2024-02-02 17:05:20 - PRE-FLIGHT CHECK: Finder & Dock are running; proceeding …
2024-02-02 17:05:20 - PRE-FLIGHT CHECK: macOS 14 installed; proceeding ...
2024-02-02 17:05:20 - PRE-FLIGHT CHECK: Caffeinating this script (PID: 94677)
2024-02-02 17:05:20 - PRE-FLIGHT CHECK: Check for Logged-in System Accounts …
2024-02-02 17:05:20 - PRE-FLIGHT CHECK: Current Logged-in User: <actual user does appear>
2024-02-02 17:05:20 - PRE-FLIGHT CHECK: Current Logged-in User First Name: <actual name does appear>
2024-02-02 17:05:20 - PRE-FLIGHT CHECK: Current Logged-in User ID: 503
2024-02-02 17:09:45 - 

In the terminal, the logs remain consistent, but there is an additional error near the bottom.

Executing Policy User Registration Prompt
Running script User Registration Prompt...
Script exit code: 1
Script result: 2024-02-02 17:15:05 - 

###
# AAD User Registration Prompt (2.0.1)
###

2024-02-02 17:15:05 - PRE-FLIGHT CHECK: Initiating …
2024-02-02 17:15:05 - PRE-FLIGHT CHECK: Finder & Dock are running; proceeding …
2024-02-02 17:15:05 - PRE-FLIGHT CHECK: macOS 14 installed; proceeding ...
2024-02-02 17:15:05 - PRE-FLIGHT CHECK: Caffeinating this script (PID: 95369)
2024-02-02 17:15:05 - PRE-FLIGHT CHECK: Check for Logged-in System Accounts …
2024-02-02 17:15:05 - PRE-FLIGHT CHECK: Current Logged-in User: <actual user does appear>
2024-02-02 17:15:05 - PRE-FLIGHT CHECK: Current Logged-in User <actual name does appear>
2024-02-02 17:15:05 - PRE-FLIGHT CHECK: Current Logged-in User ID: 503
/Library/Application Support/JAMF/tmp/User Registration Prompt:248: = not found

Error running script: return code was 1.

The script is executed through a Jamf Pro <Version 11.1.1> Policy, and the script remains unchanged with the necessary parameters specified. The parameters are as follows: #4 /private/var/log/com.company.log, #5 true (I have also tested leaving it blank), #6 true (I have also tested leaving it blank), and #7 with the correct policy ID. Do you have any insights into what might be causing this problem?

I have executed the script as a command file to remove the Jamf Pro component, but the same error persists.

sudo /Users/USER/Pictures/User\ Registration\ Prompt.command 

Picture of the Jamf Pro Policy

Screenshot 2024-02-02 at 5 51 05 PM Screenshot 2024-02-02 at 5 51 09 PM

TheRealConJon commented 7 months ago

I am having this same problem

benwhitis commented 6 months ago

Hey @swolosin @TheRealConJon thanks for opening this issue, @robjschroeder and I were able to reproduce the issue and then modify the script to resolve.

On line 248 we changed from this: if [ "${useSwiftDialog}" == "true" ]; then

To this: if [[ "${useSwiftDialog}" == "true" ]]; then

Let us know if the latest version still throws an error.