Improve script-user-remove
This commit is contained in:
@@ -5,13 +5,18 @@
|
||||
parent="${BASH_SOURCE[0]}"
|
||||
parent=${parent%/*}
|
||||
|
||||
unset user
|
||||
|
||||
[[ -f "$parent"/functions ]] && . "$parent"/functions || exit 1
|
||||
|
||||
is_root
|
||||
|
||||
[[ ! $# -eq 1 ]] && echo "Must provide a username" && exit 1
|
||||
|
||||
if [[ $# -eq 1 ]]; then
|
||||
user="$1"
|
||||
else
|
||||
echo "Must provide exactly one argument (username)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! id -u "$user"; then
|
||||
echo "User $user does not exist"
|
||||
|
||||
Reference in New Issue
Block a user