Improve script-user-remove

This commit is contained in:
2022-01-23 13:03:15 -05:00
parent b89d02a5d1
commit 0b9971e842

View File

@@ -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"