But that's just a math problem. Long before we had all these fancy interactive user adding gadgets, I was writing automated tools to add users (with no interaction) in Perl version 3(!).
I find it odd that you're trying to take a tool that was meant to be more handholding and interactive and make it less interactive. {grin}
| [reply] [Watch: Dir/Any] |
On my system, adduser is just a symlink to useradd. And it doesn't have a firstuid option. However, if no uid is supplied on the command line, it picks the first available uid above 99, and above any other user.
If I were to write such a tool (and I've done so in the past), I'd just open /etc/passwd and /etc/shadow for append (if needed /etc/group as well) and write the necessary lines. But that's just me. Or I use useradd/adduser to setup everything, but the password, and require the user to visit my office and type in his/her password.
| [reply] [Watch: Dir/Any] |