diff options
author | ahriman <ahriman@falte.red> | 2019-03-26 20:05:50 +0000 |
---|---|---|
committer | ahriman <ahriman@falte.red> | 2019-03-26 20:05:50 +0000 |
commit | 437c17698d3f06fa3a34a12ba1c0604714aa2a61 (patch) | |
tree | 934ba6b949eafdfa77e3eee1faabe5218e983daf /bin/makeuser | |
parent | 2a0d6d2bba2148b8c96622b04e2d85c57bd07f48 (diff) | |
download | admin-437c17698d3f06fa3a34a12ba1c0604714aa2a61.tar.gz |
makeuser now dies if user exists
Diffstat (limited to 'bin/makeuser')
-rwxr-xr-x | bin/makeuser | 5 |
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 ;; |