Re: specialized subdirectory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> have you considered simply writing a shell script to do this for you?
> e.g.
> (off the top of my head, so apologies for clumsiness)
> e.g /root/bin/users.sh
> # --begin--#
> #!/bin/bash
> for user in $*
> do
> useradd -d /home/share $user
> install -o $user -g (users primary group) -d /home/share/.$user-mail
> done
> # -- end
> 
> and call it with 
> users.sh user1 user2 user3 user4 (etc etc)
> 
> if you don't like the install command, you can always replace it with mkdir 
> and chown
> 
> I assume your setup means that all your users share the same primary group?

They do share the same primary group.  There is actually external software (a web based control panel) adding the users and I was hoping for something that could be triggered by the 'useradd' function (kind of like how /var/spool/mail/$USER gets created instantly).    I've combed over features in login.defs pretty well and it doesn't seem to have it.  Fortunately, the sendmail service gets restarted whenever a user is added so I can put the commands into the sendmail init script. Otherwise a shell script would have to come along every (hour?/minute?/some-time-interval)  to do the work.  

appreciate the tipoff for the 'install' command.  I will likely use that.   


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux