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

Debconf code for getting usernames list


I am the maintainer of the kismet package and on installation time I
need to ask for the user to specify which users should go in the
kismet group, which is used in order to avoid running kismet as root.
Currently [1] this is done like this :

addgroup --quiet --system $GROUP
db_get kismet/install-users
if [ "$RET" != "" ]; then
    for x in ${RET}; do
        usermod -a -G $GROUP $x

My problem is that sometimes the users might specify a wrong list
(comma-separated instead of space-separated, a typo in the username,
etc). This means that the usermod command will fail and actually this
will be shown as an error (code 6) in the installation of the package.
What is the proper way to check that each member of the $RET list is a
valid username and if not prompt the user to specify a new correct

[1] http://sources.debian.net/src/kismet/2013.03.R1b-3/debian/kismet.postinst/

Thanks in advance,


Reply to: