Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User Folders




On Oct 27, 2004, at 11:07 AM, Bobby Knueven wrote:

I have an X-Serve, Raid setup with 10.3.5 and would like to copy a preference file to all of my users home directories stored on my RAID. Is there an easy way to do this?


I was going to write a script, but then I just looked in my list archive and found this one. I think Jason Deraleau wrote it. Give it a try.


Josh

#!/usr/bin/env bash

# Configuration
HOMEDIRS="/Users"
FILETOCOPY="/Users/admin/somefileorother"
DESTINATION="Library/Preferences"

# End Configuration


# Let's make sure we have the appropriate privileges
if [ ${UID} == 0 ]; then
# Do our thing
for i in $(ls ${HOMEDIRS})
do
if [ -d ${HOMEDIRS}/${i}/${DESTINATION} ]; then
cp ${FILETOCOPY} ${HOMEDIRS}/${i}/${DESTINATION}/
chown ${i} ${HOMEDIRS}/${i}/${DESTINATION}/$(basename ${FILETOCOPY})
fi
done
else
echo "Please use sudo or su to run this script with superuser
privileges."
exit 1
fi
-
Josh Wisenbaker, ACSA
Sr. Systems Engineer
ComputerTree Technologies
1-800-467-9820


_______________________________________________ Do not post admin requests to the list. They will be ignored. Macos-x-server mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden
References: 
 >User Folders (From: Bobby Knueven <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.