summaryrefslogtreecommitdiff
path: root/localadduser
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-09-17 02:19:52 +0200
committerJonas Smedegaard <dr@jones.dk>2010-09-17 02:19:52 +0200
commitdb9b337eaf5405b5fc0b1434ba181cd734bebcec (patch)
treefc1bd72df69b2a74ba4de98a10b904c851810066 /localadduser
parent15e81c84bef76af267bae139b5cda666cb3f95b2 (diff)
Fix check if user exist. Add a bunch of TODOs.
Diffstat (limited to 'localadduser')
-rwxr-xr-xlocaladduser9
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