diff --git a/libs/useradd.lunar b/libs/useradd.lunar index 0ac401846..c4a443fce 100644 --- a/libs/useradd.lunar +++ b/libs/useradd.lunar @@ -47,7 +47,9 @@ function add_priv_group() { exit 1 fi verbose_msg "creating group \"$GROUPNAME\" with id=\"$N\"" - groupadd -g $N $GROUPNAME + if ! groupadd -g $N $GROUPNAME ; then + return 1 + fi fi if [ -n "$INSTALLWATCHFILE" ] ; then @@ -104,7 +106,9 @@ function add_priv_user() { shift verbose_msg "creating user \"$USERNAME\" (opts=\"-u $N -g $GROUPNAME $@\")" - useradd -u $N -g $GROUPNAME $USERNAME $@ + if ! useradd -u $N -g $GROUPNAME $USERNAME $@ ; then + return 1 + fi fi