Skip to content

Commit

Permalink
Merge pull request #1 from jayalpes/jayalpes-patch-ldap_param
Browse files Browse the repository at this point in the history
Update checkLdapPwdExpiration.sh
  • Loading branch information
jayalpes committed Dec 3, 2020
2 parents 026c70b + 3cbc1f2 commit f76b630
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions checkLdapPwdExpiration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@
#
MY_LDAP_HOSTURI="ldap://localhost:389"

#
# LDAP custom parameters
# eg: -E pr=500/noprompt
# eg: -o ldif-wrap=no
# eg: -Q -Y EXTERNAL
# eg (default): -x
#
# For Authentication use : -E pr=500/noprompt -o ldif-wrap=no -x
# For socket use : -E pr=500/noprompt -o ldif-wrap=no -Q -Y EXTERNAL
#
#LDAP_PARAM="-E pr=500/noprompt -o ldif-wrap=no -x"

#
# LDAP root DN (optional)
# eg: cn=Manager,dc=example,dc=com
Expand Down Expand Up @@ -135,12 +147,11 @@ MY_LDAP_MAIL_ATTR=mail
#
export LC_ALL=en_US.UTF-8


#
# Mail from
#MY_MAIL_FROM=""

#
#MY_MAIL_FROM="noreply@yo.com"

# Mail body message, with particular variables :
# %name : user name
# %login : user login
Expand Down Expand Up @@ -222,7 +233,9 @@ getTimeInSeconds() {
tmp_dir="/tmp/$$.checkldap.tmp"
result_file="${tmp_dir}/res.tmp.1"
buffer_file="${tmp_dir}/buf.tmp.1"
ldap_param="-LLL -H ${MY_LDAP_HOSTURI} -x"
[ -z "${LDAP_PARAM}" ] && LDAP_PARAM="-x" # default authorization
echo "${LDAP_PARAM}" | grep -E "Q|Y|x" 1>/dev/null || LDAP_PARAM="${LDAP_PARAM} -x"
ldap_param="${LDAP_PARAM} -LLL -H ${MY_LDAP_HOSTURI}"
nb_users=0
nb_expired_users=0
nb_warning_users=0
Expand Down

0 comments on commit f76b630

Please sign in to comment.