mirror of
https://github.com/lldap/lldap.git
synced 2026-03-31 15:07:48 +01:00
bootstrap.sh: use exact match instead of substring when checking user id existence
Signed-off-by: Binh-Nguyen Tran <tbnguyen1407@gmail.com>
This commit is contained in:
@@ -252,7 +252,7 @@ get_users_list() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
user_exists() {
|
user_exists() {
|
||||||
if [[ "$(get_users_list | jq --raw-output --arg id "$1" '.data.users | any(.[]; contains({"id": $id}))')" == 'true' ]]; then
|
if [[ "$(get_users_list | jq --raw-output --arg id "$1" '.data.users | any(.[]; .id == $id)')" == 'true' ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user