From 437c17698d3f06fa3a34a12ba1c0604714aa2a61 Mon Sep 17 00:00:00 2001 From: ahriman Date: Tue, 26 Mar 2019 20:05:50 +0000 Subject: makeuser now dies if user exists --- bin/makeuser | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin/makeuser') 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 ;; -- cgit 1.4.1-2-gfad0