Imre, I like the single call to getent better than the grep as well. There is an added benefit, which is that this key is taken literally, while passing it to grep may actually cause false positives by parsing as a regular expression. For instance, if you have a user
ftpuser
and you input
ftp.ser
As the user during configuration of vsftpd, it will match the . against the u and NOT create the user.
Imre, I like the single call to getent better than the grep as well. There is an added benefit, which is that this key is taken literally, while passing it to grep may actually cause false positives by parsing as a regular expression. For instance, if you have a user
ftpuser
and you input
ftp.ser
As the user during configuration of vsftpd, it will match the . against the u and NOT create the user.