Skip to main content
Question

Wither DMG...here is a loop script for PKG

  • November 10, 2011
  • 2 replies
  • 0 views

donmontalvo
Forum|alt.badge.img+36

!/bin/sh

#
# Copy stuff to existing/future users, set ownership and permissions.
#

# Copy to User Template and set root:wheel ownership

/usr/bin/ditto /tmp/USERCRAP /System/Library/User Template/English.lproj
/usr/sbin/chown -R root:wheel /System/Library/User Template/English.lproj

# Copy to existing user directories and set ownership and permissions.

for i in $(/bin/ls /Users | sed -e '/Shared/d' -e '/Deleted Users/d' -e '/.localized/d' -e '/.DS_Store/d' -e '/.com.apple.timemachine.supported/d' -e '/Adobe/d' -e '/Library/d');

do

/usr/bin/ditto /tmp/USERCRAP /Users/$i
/usr/sbin/chown -R $i:staff /Users/$i

done

exit 0

2 replies

donmontalvo
Forum|alt.badge.img+36
  • Author
  • Legendary Contributor
  • 4293 replies
  • November 11, 2011

I forgot to provide credit for the above script...Tom Larkin and Steve Wood (and a few others on this list).

Don


donmontalvo
Forum|alt.badge.img+36
  • Author
  • Legendary Contributor
  • 4293 replies
  • November 11, 2011

Ahhh...just noticed the Script button...let's see if this works:

#!/bin/sh
#
# Copy stuff to existing/future users, set ownership and permissions.
#
# Thanks to Tom Larkin and Steve Wood and the others at JAMF Nation.

# Copy to User Template and set root:wheel ownership

/usr/bin/ditto /tmp/USERCRAP /System/Library/User Template/English.lproj
/usr/sbin/chown -R root:wheel /System/Library/User Template/English.lproj

# Copy to existing user directories and set ownership and permissions.

for i in $(/bin/ls /Users | sed -e '/Shared/d' -e '/Deleted Users/d' -e '/.localized/d'
-e '/.DS_Store/d' -e '/.com.apple.timemachine.supported/d' -e '/Adobe/d' -e '/Library/d');

do

/usr/bin/ditto /tmp/USERCRAP /Users/$i
/usr/sbin/chown -R $i:staff /Users/$i

done

exit 0

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings