Hey everyone,
I am new to Dockutil and am having an issue running the script while imaging. The laptops being imaged are 10.11.3 MacBook Airs and Pros. What I want out of Dockutil is to add Google Chrome and Slack to newly imaged docks. I have created a pkg of Dockutil to download on each machine during imaging as well as a dmg (captured in Composer) that moves the Dockutil script to the /usr/local/bin location. I also set up a policy to execute the command "sh /usr/local/bin/dockutiltest.sh" that runs upon login once per computer per user. Both the pkg and dmg are loaded and stored on the machine; however, when I look at the policy logs I get plist errors:
Executing Policy Execute Dockutil Script
Running command sh /usr/local/bin/dockutiltest.sh...
Result of command:
/var/root/Library/Preferences/com.apple.dock.plist does not seem to be a home directory or a dock plist
/var/root/Library/Preferences/com.apple.dock.plist does not seem to be a home directory or a dock plist
No matching processes were found
Running Recon...
Retrieving inventory preferences from https://casper.boost.caffeine.io:8443/...
Locating accounts...
Searching path: /Applications
Locating package receipts...
Locating software updates...
Locating printers...
If I'm on the machine's terminal and execute commands, it works. I'm not sure what else I can change/edit to make the script run either after it reboots from imaging or upon login. Here is the script I have in the dmg that should run on each machine:
!/bin/bash
/usr/local/bin/dockutil --add '/Applications/Slack.app'
/usr/local/bin/dockutil --add '/Applications/Google Chrome.app'
killall -KILL Dock
I also want to note that I know you can make policies that update the dock for you but I don't want to scope that to "all computers" because this should be solely on fresh imaged machines.
Any ideas or suggestions would be extremely helpful!!! Thanks guys!!