Sort users to avoid differences between each runs

This commit is contained in:
Jeremy Gardais 2021-11-29 12:05:37 +01:00
parent 2cc9078ad9
commit 6b130315dd
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 3 additions and 1 deletions

View File

@ -254,7 +254,9 @@ get_ldap_user_list() { # {{{
Create or empty ${RED}${ldap_user_list_path}${COLOR_DEBUG} file to store user list of ${RED}${ldap_group_cn}${COLOR_DEBUG} LDAP group." Create or empty ${RED}${ldap_user_list_path}${COLOR_DEBUG} file to store user list of ${RED}${ldap_group_cn}${COLOR_DEBUG} LDAP group."
true > "${ldap_user_list_path}" true > "${ldap_user_list_path}"
if command ldapsearch -ZZ -D "${ldap_user}" -w "${ldap_passwd}" -H "${ldap_server}" -s one -b "${ldap_group_base}" "(cn=${ldap_group_cn})" member | sed -n 's/\(^member: uid=\)\(.*\)\(,ou=.*\)/\2/p' > "${ldap_user_list_path}"; then if command ldapsearch -ZZ -D "${ldap_user}" -w "${ldap_passwd}" -H "${ldap_server}" -s one -b "${ldap_group_base}" "(cn=${ldap_group_cn})" member \
| sed -n 's/\(^member: uid=\)\(.*\)\(,ou=.*\)/\2/p' \
| sort > "${ldap_user_list_path}"; then
if [ -s "${ldap_user_list_path}" ]; then if [ -s "${ldap_user_list_path}" ]; then
debug_message "get_ldap_user_list \ debug_message "get_ldap_user_list \
${RED}${ldap_group_cn}${COLOR_DEBUG} users list successfully created (see ${ldap_user_list_path} file)." ${RED}${ldap_group_cn}${COLOR_DEBUG} users list successfully created (see ${ldap_user_list_path} file)."