Closed remusache closed 5 years ago
@remusache DockBuilder is designed to create a breadcrumb for existing user accounts where the dock has already been set up. However, I allowed for modifications to this with the SkipInitialBreadcrumbUsers key in the prefs plist. If you know the username of the individual you can add it there.
In the more likely event that you do not know the username you want to skip, I suggest the following:
loggedInUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }')
if [[ "$skipInitialBreadcrumbUsers" =~ $userName ]] || [[ "$loggedInUser" == "$userName" ]]; then
Thank you so much for getting back to me @ryangball. You were right in your assumption that I don't know the username, I mean I know it but it changes every time we install a new Mac.
I added/changed the suggested modifications in the postinstall.sh file but the Dock is still unchanged upon install completion.
So is the breadcrumb getting created for the logged in user when the package installs?
I see the issue, I made an error in the above code. The last variable should read “$userName”.
So instead of if [[ "$skipInitialBreadcrumbUsers" =~ $userName ]] || [[ "$loggedInUser" == "$userName" ]]; then it should be if [[ "$skipInitialBreadcrumbUsers" =~ "$userName" ]] || [[ "$loggedInUser" == "$userName" ]]; then
Beautiful :) Is not right after the installation finishes, but after restarting the machine, the Dock is changed. The breadcrumb is not created anymore during installation.
Thank you so much for taking the time to help me out.
No problem, just to confirm, the line should be:
if [[ "$skipInitialBreadcrumbUsers" =~ $userName ]] || [[ "$loggedInUser" == "$userName" ]]; then
Now I'm confused… :) If you say the line should be like the one bellow, then it's the same as the original line from your first post and then the breadcrumb is created.
if [[ "$skipInitialBreadcrumbUsers" =~ $userName ]] || [[ "$loggedInUser" == "$userName" ]]; then
When I changed the line like the one bellow
if [[ "$skipInitialBreadcrumbUsers" =~ "$userName" ]] || [[ "$loggedInUser" == "$userName" ]]; then
then no breadcrumb is created and the Dock is changing after restart..
Sorry, I caused the confusion as I edited my original comment to correct the code after you mentioned it did not work.
Solved! Thank you Ryan!
Hello! I am deploying the package via JAFM Pro and I would like, if possible, as soon as DockBuilder is installed and runs, the Dock is modified as well for the currently logged in user. Right now after JAMF installs the DockBuilder.pkg, nothing happens to the user's Dock. I have to remove the breadcrumb, restart the machine and only then the Dock is modified.
Thank you for your time and consideration.
Kind Regards Remus