mirror of
https://github.com/ThunixdotNet/makeuser.git
synced 2026-01-24 13:40:17 +00:00
Move arguments check
This commit is contained in:
2
makeuser
2
makeuser
@@ -15,6 +15,7 @@ CONFIG=./setenv
|
|||||||
source include/functions
|
source include/functions
|
||||||
|
|
||||||
[[ $(id -u) == 0 ]] && error_exit "Do not run this script as root."
|
[[ $(id -u) == 0 ]] && error_exit "Do not run this script as root."
|
||||||
|
[[ $# -ne 3 ]] && error_exit "not enough args"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
-h | --help)
|
-h | --help)
|
||||||
@@ -22,7 +23,6 @@ case $1 in
|
|||||||
-* | --*)
|
-* | --*)
|
||||||
usage; error_exit "unknown option $1" ;;
|
usage; error_exit "unknown option $1" ;;
|
||||||
*)
|
*)
|
||||||
[[ $# -ne 3 ]] && error_exit "not enough args"
|
|
||||||
$(sudo grep -qiw $1 $BANNED) && error_exit "$1 is on the ban list!"
|
$(sudo grep -qiw $1 $BANNED) && error_exit "$1 is on the ban list!"
|
||||||
|
|
||||||
#adding new user
|
#adding new user
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ CONFIG=./setenv
|
|||||||
source include/functions
|
source include/functions
|
||||||
|
|
||||||
[[ $(id -u) == 0 ]] && error_exit "Do not run this script as root."
|
[[ $(id -u) == 0 ]] && error_exit "Do not run this script as root."
|
||||||
|
[[ $# -ne 3 ]] && error_exit "not enough args"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
-h | --help)
|
-h | --help)
|
||||||
@@ -21,7 +22,6 @@ case $1 in
|
|||||||
-* | --*)
|
-* | --*)
|
||||||
usage; error_exit "unknown option $1" ;;
|
usage; error_exit "unknown option $1" ;;
|
||||||
*)
|
*)
|
||||||
[[ $# -ne 3 ]] && error_exit "not enough args"
|
|
||||||
$(sudo grep -qiw $1 $BANNED) && error_exit "$1 is on the ban list!"
|
$(sudo grep -qiw $1 $BANNED) && error_exit "$1 is on the ban list!"
|
||||||
|
|
||||||
#adding new user
|
#adding new user
|
||||||
|
|||||||
Reference in New Issue
Block a user