Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Resetting permissions on multiple user folders' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Resetting permissions on multiple user folders
Authored by: alexiskai on Apr 14, '03 08:58:29PM

The way I actually have it set up (I wrote and submitted this hint) is cd /Volumes/Storage/Users because, as you said, my Users folder is in a different location.

The only problem with changing it to cd ~/.. is that the user I usually execute these things from actually has its home folder in /Users, ironically. And if one were to execute it from root for whatever reason it wouldn't work at all. So perhaps better to simply hard-code the location of the Users folder you intend to manage.

I wrote the script mostly because I've had to reinstall the server OS a couple of times while leaving the Users folder alone since it's on a separate partition, and it's handy for making sure OS X understands that user john_doe on the new system should own the folder created by john_doe on the old system.



[ Reply to This | # ]
Resetting permissions on multiple user folders
Authored by: nicola on Apr 15, '03 05:09:43AM
You have already used nireport, so why not use niutil for getting a user's home directory? You may do something like

HomeDirLocation=`niutil -read . /users/$UserName | grep "home: " | sed 's/home\:\ //g'`

note: the above line is for the local domain; I don't have a server at hand, so I can't tell if "home: " (and the following "home\:\ ") will work for network domains too... (maybe not)

[ Reply to This | # ]
Resetting permissions on multiple user folders
Authored by: mithras on Apr 15, '03 08:23:37AM
What you want is:
HomeDir=`niutil -readprop / /users/$UserName home`

---
--
my free OS X applications and scripts

[ Reply to This | # ]

Resetting permissions on multiple user folders
Authored by: nicola on Apr 15, '03 10:20:57AM

Hey thanks!
Guess I should always read ALL the man page...

And: does anyone know if the "home" property is ok for OSX server too?



[ Reply to This | # ]