fixx add_user script
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mauro Torrez 2019-09-30 19:46:27 -03:00
parent aa2b9b5dca
commit 3b877a763f

View File

@ -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!"