Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ldap-auth.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

#
# ldap-auth.sh - Simple shell script to authenticate users against LDAP
Expand Down Expand Up @@ -201,6 +201,9 @@ case "$CLIENT" in
ldap_auth_curl
;;
"ldapsearch")
if [ -z "$(which ldapsearch)" ]; then
apk add openldap-clients
fi
ldap_auth_ldapsearch
;;
*)
Expand Down Expand Up @@ -231,7 +234,6 @@ if [ $result -ne 0 ]; then
type on_auth_failure > /dev/null && on_auth_failure
exit 1
fi

log "User '$username' authenticated successfully."
type on_auth_success > /dev/null && on_auth_success
exit 0