diff --git a/duplicati/create.homedir.sh b/duplicati/create.homedir.sh index dd04ff6..9722d52 100755 --- a/duplicati/create.homedir.sh +++ b/duplicati/create.homedir.sh @@ -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." 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 debug_message "get_ldap_user_list − \ ${RED}${ldap_group_cn}${COLOR_DEBUG} users list successfully created (see ${ldap_user_list_path} file)."