nALFS feature request
timothy at foce.eiomail.com
Wed May 15 14:07:15 PDT 2002
Neven Has <haski at sezampro.yu> spake:
> > what do you think about a possibility to check wether a user or
> > exists and only make it if it does not exist, kinda like mkdir -p?
useradd and groupadd will not add a user or
a group which already exists.
> For this, we would have to add a separate element for useradd/groupadd
> and an option to do it.
> Or, you could use something like:
> if [ "`grep ^lfs /etc/passwd`" = "" ] ; then
> useradd -s /bin/bash -m &lfs-user;
> There is probably a better way for the above (and it's not tested),
> but you get the idea... :)
what if you had a user named bolfsi? wouldn't the
above cause problems? i think this would be more
appropriate for checking if the user lfs exists:
if [ "`cut -d: -f1 /etc/passwd | grep -x lfs`" = "" ];
-*- "Share and Enjoy" || "Go stick your head in a pig" -*-
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message
More information about the alfs-discuss