fix 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:51:58 -03:00
parent 3b877a763f
commit 656382d46b

View File

@ -5,6 +5,7 @@ usage() {
usage: docker exec [...] add_ldap_user [-c COMMON_NAME] [-s SURNAME] [-u UID] [-p PASSWORD] [-e EMAIL] usage: docker exec [...] add_ldap_user [-c COMMON_NAME] [-s SURNAME] [-u UID] [-p PASSWORD] [-e EMAIL]
Unset options will be prompted interactively. Unset options will be prompted interactively.
EOF EOF
}
COMMON_NAME= COMMON_NAME=
USER_UID= USER_UID=
@ -74,7 +75,7 @@ assert "User already present. Please choose a different UID."
echo -n "Enter user email (leave blank for ${USER_UID}@${LDAP_DOMAIN}) > " echo -n "Enter user email (leave blank for ${USER_UID}@${LDAP_DOMAIN}) > "
read USER_EMAIL read USER_EMAIL
} }
[[ -n ${USER_EMAIL} ]] || USER_EMAIL="${USER_UID}@${LDAP_DOMAIN}" USER_EMAIL="${USER_EMAIL:=${USER_UID}@${LDAP_DOMAIN}}"
PWHASH=$(slappasswd -h "{SSHA}" -s "${USER_PASS}") PWHASH=$(slappasswd -h "{SSHA}" -s "${USER_PASS}")