[K12OSN] OT: Help with Template User Script

R. Scott Belford scott at hosef.org
Mon Nov 26 23:13:04 UTC 2007


Peter Hartmann wrote:
> Eric sent this beauty out a while back when I was stuck.
> 
> -Peter
> 
> version 0.4:
> 
>   getent passwd | awk -F: '$3>500 {print $3, $4, $6}' | while read u g h
>   do
>      chown -R $u:$g "$h"
>   done

Man.  That seems too simple to be true, but it looks right.  Elegant. 
I'll sandbox it.


James P. Kinney III wrote:

> Are the goofs "all perms not reset" or "some perms reset" or "unknown"?

It's just some, James.  It is bizarre.  So far, from the last reset, 
only one user out of over 400.  Perhaps since I am running this script 
on the ldap server hosting the home directories, I need to use "getent 
passwd" as it is different than the result of $USER from ls?

> 
> Also, is a space allowed in a group name? The chown line has a
> backslashed space in "Domain Users". I thinks that's a no-no but I can't
> pull a reference for it.

I believe this is okay.  The group is Domain Users, and the syntax for 
handling the space is trail the first word with a \.

> 
> There is a script in K12LTSP (in /opt/k12ltsp/templates) that is used to
> reset user . files back to a sane pattern based on what's in /etc/skel.
> That process explicitly names .gnome, .kde, etc directories.

Yes, but this is an Edubuntu install.  Time for a virtual K12LTSP 
install so that I can start referencing all the amazing tweaks and 
scripts in the K12LTSP.

I've said it before, and I'll say it again, all the tweaks and 
modifications that make the K12LTSP so magically delicious are both 
amazing and scary.  Finding what isn't ready out-of-the-box with 
Edubuntu has been enlightening, to put it mildly.

--scott




More information about the K12OSN mailing list