[Casper] dock problem

Thomas Larkin tlarki at kckps.org
Thu May 28 13:01:25 PDT 2009


Sorry if this is way off, but why not capture it with composer and then
have it fill existing users and make it self healing so it can't be
altered? 

What is stopping the users from deleting these preferences? 

Just a thought. 

Tom 



>>> "John McLaughlin" <John_McLaughlin at newton.k12.ma.us> 05/28/09 2:58
PM >>>

Thanks so much for the help.  I will try that.   


> 
John McLaughlin 

Technical Support Specialist 

Newton Public Schools 


>
> 
Charlie Butters <charlie.butters at shopko.com> writes: 

John, 


> 
Don¹t know if this will help, but here is another iteration to try. I
think 

you definitely want to run the defaults command as the user, so using su
. 

In my experience when doing that, I have always used the following
syntax 

(your kidspiration iteration is closest to what I have used): 


> 
if [[ -e "$kidspiration" ]]; then 

su - "$user" -c ³defaults write 

/Users/$user/Library/Preferences/com.apple.dock 

persistent-apps -array-add 

Œ<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString


</key><string>/Applications/Kidspiration 2/Kidspiration 

2.app/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict>


</dict>¹² 

fi 


> 
Don¹t know how the single/double quotes will come across in the email,
but 

basically, here is what I suggest trying: 


> 
* add a dash between su and $user 

* add the ­c flag after $user. 

* put the entire defaults command in double quotes 

* put single quotes around the <dict>....</dict> directive within that 

command 


> 
Again, that¹s real close to what you have tried, so it may not make a 

difference, but that would be the next thing I would try. 


> 
-- 

Charlie Butters 

Shopko Stores 

charlie.butters at shopko.com 


>
>
> 
Date: Wed, 27 May 2009 16:07:12 -0400 

From: "John McLaughlin" <John_McLaughlin at newton.k12.ma.us> 

Subject: [Casper] dock problem.. 

To: "Casper List" <casper at list.jamfsoftware.com> 

Message-ID: 

   <fc.000f49c2052872be000f49c2052872be.5287400 at newton.k12.ma.us (
fcp://fc.000f49c2052872be000f49c2052872be.5287400@newton.k12.ma.us )> 

Content-Type: text/plain; charset="iso-8859-1" 


> 
Okay, so this is the latest status on my dock problem.  I have this
script 

which I can run locally on any given user and it will create a dock item


for any of these programs that are present on the system.  However, it 

will not work if I launch it through Casper.  As you can see, I've tried


many different methods to get defaults to work for the logged in user
but 

all I see is the dock relaunching.  Does anyone have any ideas?  Has 

anyone done anything like this? 


>
> 
#!/bin/sh 


>
> 
# Applications 

user=`ls -l /dev/console | cut -d " " -f 4` 

username=`/usr/bin/w | grep console | awk '{print $1}'` 

current_user=`/usr/bin/finger -s -l | grep Login | awk '{print $2}'` 

kid_pix="/Applications/Kid Pix Deluxe 4" 

ttl="/Applications/Type To Learn 3" 

kidspiration="/Applications/Kidspiration 2" 

inspiration="/Applications/Inspiration 8" 


> 
echo "3=$3" 

echo "user=$user" 

echo "username=$username" 

echo "current_user=$current_user" 

#sleep 20 


> 
if [[ -e "$kid_pix" ]]; then 

su $user defaults write
/Users/macuser/Library/Preferences/com.apple.dock 

persistent-apps -array-add 

"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString


</key><string>/Applications/Kid 

Pix Deluxe 4/Kid Pix Deluxe 

4/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></di


ct>" 

fi 


> 
if [[ -e "$kidspiration" ]]; then 

su "$user" defaults write
/Users/$user/Library/Preferences/com.apple.dock 

persistent-apps -array-add 

"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString


</key><string>/Applications/Kidspiration 

2/Kidspiration 

2.app/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict>


</dic"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString


</key><string>/Applications/Inspiration 

8/Inspiration 

8.app/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict>


</dict>" 

fi 


> 
if [[ -e "$ttl" ]]; then 

defaults write /Users/$current_user/Library/Preferences/com.apple.dock 

persistent-apps -array-add 

"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString


</key><string>/Applications/Type 

To Learn 3/Type To Learn 

3/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></di


ct>" 

fi 


> 
killall Dock 


>
> 
exit 0 


>
> 
John McLaughlin 

Technical Support Specialist 

Newton Public Schools 


> 
_______________________________________________ 

Casper mailing list 

Casper at list.jamfsoftware.com 

http://list.jamfsoftware.com/mailman/listinfo/casper 


>
>
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20090528/aa6fe6ba/attachment.htm 


More information about the Casper mailing list