Re: Push a plist file to all users - ownership question
Re: Push a plist file to all users - ownership question
- Subject: Re: Push a plist file to all users - ownership question
- From: Jason Pelletier <email@hidden>
- Date: Wed, 3 Nov 2010 10:55:29 +0000
- Thread-topic: Push a plist file to all users - ownership question
If you don't care about the group ownership as much you cam just add a single line to the loop you already have. We do this all the time.
> #!/bin/sh
> #
> # loop
> for i in $(/bin/ls /Users)
> do
> /usr/bin/ditto /System/Library/User\ Template/English.lproj/Library/Preferences/com.mypreference.plist /Users/$i/Library/Preferences/com.mypreference.plist
chown $i:staff /Users/$i/Library/Preferences/com.mypreferences.plist
> done
> exit 0
>
>
Jason
On Nov 3, 2010, at 1:31 AM, "Don Montalvo" <email@hidden> wrote:
> We have a plist file we need to push out to the User Template and all existing users. We can push them easily to the User template since we know the plist files need to be owned by root:wheel. However, putting a copy of this file in each existing user's home directory is proving to be a challenge.
>
> We can use ditto to copy the file to each user's home directory:
>
> #!/bin/sh
> #
> # loop
> for i in $(/bin/ls /Users)
> do
> /usr/bin/ditto /System/Library/User\ Template/English.lproj/Library/Preferences/com.mypreference.plist /Users/$i/Library/Preferences/com.mypreference.plist
> done
> exit 0
>
> But how do we then set the ownership of the file to each respective user? I hope it's something we can add to the above script. Perhaps another loop function?
>
> PS, This is a vendor provided plist file that isn't compatible with defaults command, so we have to push the file out to everyone.
>
> Thanks,
> Don _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Installer-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden