Fix edge case script-user-reset-password
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
# This script will reset a user password on the server
|
# This script will reset a user password on the server
|
||||||
# Copyright 2021 Bryan C. Roessler
|
# Copyright 2021 Bryan C. Roessler
|
||||||
|
|
||||||
|
declare user=""
|
||||||
|
|
||||||
parent="${BASH_SOURCE[0]}"
|
parent="${BASH_SOURCE[0]}"
|
||||||
parent=${parent%/*}
|
parent=${parent%/*}
|
||||||
|
|
||||||
@@ -17,7 +19,7 @@ is_root
|
|||||||
|
|
||||||
[[ $# -gt 2 ]] && "Too many arguments" && exit 1
|
[[ $# -gt 2 ]] && "Too many arguments" && exit 1
|
||||||
|
|
||||||
if ! id -u "$user"; then
|
if ! id -u "$user" ; then
|
||||||
echo "User $user does not exist"
|
echo "User $user does not exist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user