diff options
Diffstat (limited to 'localadduser')
-rwxr-xr-x | localadduser | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/localadduser b/localadduser index 677131c..213d4d9 100755 --- a/localadduser +++ b/localadduser @@ -119,14 +119,10 @@ done if [ ! "$interactive" -gt 0 ]; then quiet="--quiet" fi -if [ -n "$fullname$office$office_phone$home_phone$other" ]; then - eval $simulate sudo "/usr/sbin/adduser $quiet --disabled-login --gecos \"$fullname,$office,$office_phone,$home_phone,$other\" \"$u\"" -else - if [ ! "$interactive" -gt 0 ]; then - exit1 "Not enough info provided to create account for \"$u\"!" - fi - eval $simulate sudo "/usr/sbin/adduser --disabled-login \"$u\"" -fi + +# adduser is too pessimistic on --gecos size +eval $simulate sudo "/usr/sbin/adduser $quiet --disabled-login --gecos \"\" \"$u\"" +eval $simulate sudo "/usr/sbin/usermod -c \"$fullname,$office,$office_phone,$home_phone,$other\" \"$u\"" for group in $groups; do eval $simulate sudo "/usr/sbin/adduser $quiet \"$u\" \"$group\"" |