diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-09-17 02:19:52 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-09-17 02:19:52 +0200 |
commit | db9b337eaf5405b5fc0b1434ba181cd734bebcec (patch) | |
tree | fc1bd72df69b2a74ba4de98a10b904c851810066 | |
parent | 15e81c84bef76af267bae139b5cda666cb3f95b2 (diff) |
Fix check if user exist. Add a bunch of TODOs.
-rwxr-xr-x | localadduser | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/localadduser b/localadduser index 292608b..5c624a6 100755 --- a/localadduser +++ b/localadduser @@ -10,6 +10,11 @@ # TODO: Check for bad arguments # TODO: Implement --help option # TODO: Support overriding options in /etc/local file +# TODO: Check gecos field length +# TODO: Check password strength of autogenerated password (and pick another if needed) +# TODO: Deal with non-ASCII chars (transliterate or silence chfn warnings) +# TODO: quiten output: only emit password line by default +# TODO: support reading from file or stdin # set -e @@ -81,6 +86,10 @@ for chunk in $@; do esac done +if getent passwd "$u" | grep -q .; then + exit1 "User \"$u\" already exists!" +fi + if [ -n "$phone_area" ]; then exit1 "Area code provided without trailing phonenumber!" fi |