diff --git a/confd/templates/add_ldap_user.tmpl b/confd/templates/add_ldap_user.tmpl index 37ae385..3d8b0f6 100644 --- a/confd/templates/add_ldap_user.tmpl +++ b/confd/templates/add_ldap_user.tmpl @@ -41,6 +41,9 @@ LDAP_ADMIN_PASSWORD="{{ getv "/admin/password" }}" LDAP_DOMAIN="{{ getv "/domain" }}" LDAP_DOMAIN_DN="{{ getv "/domain/dn" }}" +DN0="dc=${LDAP_DOMAIN//./,dc=}" +LDAP_DOMAIN_DN=${LDAP_DOMAIN_DN:=${DN0}} + [[ -n ${USER_UID} ]] || { echo -n "Enter user UID (e.g. jdoe) > " read USER_UID @@ -86,9 +89,10 @@ ldapadd -H ldapi:/// -D cn=${LDAP_ADMIN_CN},${LDAP_DOMAIN_DN} \ objectClass: top cn: ${COMMON_NAME} sn: ${SURNAME} - uid: ${USER_UID} - userPassword: ${PWHASH} - email: ${USER_EMAIL} + uid: ${USER_UID} + userPassword: ${PWHASH} + email: ${USER_EMAIL} EOF + assert "Error adding user!"