diff --git a/confd/templates/add_ldap_user.tmpl b/confd/templates/add_ldap_user.tmpl index 3d8b0f6..bd07a93 100644 --- a/confd/templates/add_ldap_user.tmpl +++ b/confd/templates/add_ldap_user.tmpl @@ -5,6 +5,7 @@ usage() { usage: docker exec [...] add_ldap_user [-c COMMON_NAME] [-s SURNAME] [-u UID] [-p PASSWORD] [-e EMAIL] Unset options will be prompted interactively. EOF +} COMMON_NAME= 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}) > " 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}")