I aim to automate the task of adding users and domains. My view may be flawed, but until I'm set straight, I think the differences are minute.
- Domain names will have a dot in the name, and adduser won't accept that (eg. wed.se).
- Domains will be moved to /var/www while user accounts are created under /home.
- There is two skeleton directories to populate the directories. One for users. One for domains.
Important is that users or domain admins, end up in their directory at login. Someone who administers a domain, should not login to /home and then have to browse through the system to the directory of their domain.
What I am thinking, is doing something that:
1. mimics adduser, but accept dots.
2. Asks if it's a domain or user and chose skel directory accordingly.
3. If it's a domain, then "usermod -d /var/www/test -m test".
Am I barking up the wrong tree here? I have never programmed before and I am a dedicated hardwareguy. So I appreciate all the help I can get. I found something that possibly is similar to what I want to do, or probably editable to suit, here: http://bashscripts.org/forum/viewtopic.php?f=7&t=603&hilit=account
. But I don't understand much of it.
I can live with adduser as it is, and have a custom script for domains. But it would be nice to have a consolidated "addacount" command.
4. I guess it is possible to add each user to the MySQL database as well. But how?