diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-09-17 03:27:53 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-09-17 03:27:53 +0200 |
commit | 721dcf1fd57c188bdf736e5c7620997af695ca42 (patch) | |
tree | 7f7b3e8b75f466757f72de02a1a22f63802b208d /localadduser | |
parent | d108cd46d94080ed9a6da8a59ee0546e1f5e8c4b (diff) |
Set GECOS using usermod (not adduser) to allow longer data stuffed in.
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\"" |