about summary refs log tree commit diff stats
path: root/bin/makeuser
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2019-03-26 20:05:50 +0000
committerahriman <ahriman@falte.red>2019-03-26 20:05:50 +0000
commit437c17698d3f06fa3a34a12ba1c0604714aa2a61 (patch)
tree934ba6b949eafdfa77e3eee1faabe5218e983daf /bin/makeuser
parent2a0d6d2bba2148b8c96622b04e2d85c57bd07f48 (diff)
downloadadmin-437c17698d3f06fa3a34a12ba1c0604714aa2a61.tar.gz
makeuser now dies if user exists
Diffstat (limited to 'bin/makeuser')
-rwxr-xr-xbin/makeuser5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/makeuser b/bin/makeuser
index 06c2d1e..73b0fd4 100755
--- a/bin/makeuser
+++ b/bin/makeuser
@@ -19,6 +19,11 @@ usage() {
 
 [[ $(id -u) != 0 ]] && error_exit "you must be the superuser to run this script."
 
+USERLIST=$(ls /home)
+if [[ $USERLIST == *$1* ]]; then
+    error_exit "User already exists!"
+fi
+
 case $1 in
   -h | --help)
     usage; exit ;;