add own program to ports + help with port / program
miklosovic.freebsd at gmail.com
Sun Sep 13 19:38:02 UTC 2009
I am about writing shell script which adds system account
by tens (even hundreds). Info about added accounts is stored
in external file which has syntax like this
account-name is name of account
comment field is comment which appears in /etc/passwd comment field
email-address is address where info about just created account is sent
joe:Joe Brown:joe at something.com <Brown%3Ajoe at something.com>
mark:Mark Red:mark at nowhere.org <Red%3Amark at nowhere.org>
tim:Tim Yellow:timmy at example.com <Yellow%3Atimmy at example.com>
Script is checking file syntax and if syntax is bad, it exits.
If it is ok, accounts is being created.
You can modify a lot of infos, these are stored in config file in
# output file with passwords of newly
# created user accounts
# uid of first created user
# root home dir of users
# comment for users, appears in /etc/passwd
# in comment field
# primary group for users, if empty,
# primary group will be a user name
# comma separated list of groups
# users should be a member of
# shell for users
# use quotas
# hard quote limit
# soft quote limit
# disk device upon which users are created
# expiration date of accounts
# length of password
as you can see, you can set quotas for users, account expiration
of accounts, password length, shell and so on. Variables in config
file are default, if you do not overwrite some at command line.
# pwgrp -a -f users -c "unix begginer" -s /usr/local/bin/bash -q -qh 2048 -l
10 (adding users)
# pwgrp -r -f remove_users (list of users for removing)
Password are generated by apg program
Quotas are set by setquotas.
The main reason I write this mail is to make some feedback about program to
and even test it and comment it.
I want to write this program but I do not know if I do it correct and I need
feedback about programming style or just some info what do you think about
At this time, there is absence of manual, but if you track code, I think
you understand it.
Any ideas are highly appreciated.
More information about the freebsd-questions