Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Add additional check for ${loggedInUser} #2

Closed
robjschroeder opened this issue Mar 6, 2023 · 7 comments
Closed

Bug Report: Add additional check for ${loggedInUser} #2

robjschroeder opened this issue Mar 6, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@robjschroeder
Copy link
Contributor

Please add an additional check to populate the ${loggedInUser} variable before the script looks to see if the variable exists. This will ensure that before the check, a recent variable check has been completed. Thank you!

loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )

https://github.com/dan-snelson/Setup-Your-Mac/blob/f195cb4ad5b9727aaf2455d320e9049a5556ea77/Setup-Your-Mac-via-Dialog.bash#L188

@dan-snelson
Copy link
Collaborator

Thanks, Obi-@robjschroeder!

@dan-snelson dan-snelson self-assigned this Mar 6, 2023
@dan-snelson
Copy link
Collaborator

@robjschroeder: I'm seeing loggedInUser defined at Line 51; what am I missing?

@dan-snelson
Copy link
Collaborator

Please advise the steps to reproduce. Thanks.

@robjschroeder
Copy link
Contributor Author

When using an Automated Device Enrollment workflow and SYM, it looks like the $loggedInUser variable is not getting populated when the script first checks on line 51, so when the script checks for the variable to be populated and not loginwindow on line 189, SYM thinks there is no loggedInUser because the variable is blank. With the additional chance for the $loggedInUser variable to be populated right before it decides to continue or exit, you have at that moment a chance to grab the correct variable, whether it is truly blank or if there is a logged In user.

This issue only seems to affect those using SYM and ADE workflows on versions 1.7.2 +

@dan-snelson
Copy link
Collaborator

Please see: dan-snelson/dialog-scripts#41

@dan-snelson
Copy link
Collaborator

@robjschroeder:

Please test-drive 1.8.1-rc1; I'd be interested to see the client-side logs.

Thanks.

@dan-snelson dan-snelson added the bug Something isn't working label Mar 9, 2023
@dan-snelson dan-snelson changed the title Add additional check for ${loggedInUser} Bug: Add additional check for ${loggedInUser} Mar 9, 2023
@dan-snelson dan-snelson changed the title Bug: Add additional check for ${loggedInUser} Bug Report: Add additional check for ${loggedInUser} Mar 9, 2023
@dan-snelson
Copy link
Collaborator

Thanks, @robjschroeder.

Addressed in 1.8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants