support/mkusers: fix warnings when adding a new user
authorYann E. MORIN <yann.morin.1998@free.fr>
Sat, 5 Apr 2014 16:24:43 +0000 (18:24 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 5 Apr 2014 16:39:16 +0000 (18:39 +0200)
commit4955a31cecb698def9eb4b395fc297e56f76d492
tree8aed80e7e8db49d56f3df370ebeab3d9c4894f52
parentc09b2bfaeaa165ccd732da787c9e28536605dc15
support/mkusers: fix warnings when adding a new user

When adding a new user (or a new group), we would get warnings, like:
  [...]/support/scripts/mkusers: line 145: [: too many arguments

This is because we're checking if a UID (or a GID) is already defined,
and/or is different from the requested one, both checks in the same
test.

Of course, if a UID (or a GID) is not defined, it does not have a value,
so we can not compare it to an integer.

Fix that by splitting the test in two, so the second is only executed if
the first is sucessful.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/scripts/mkusers