diff --git a/check-sshd-ldap.sh b/check-sshd-ldap.sh index 6cd7073..01308b7 100755 --- a/check-sshd-ldap.sh +++ b/check-sshd-ldap.sh @@ -35,7 +35,7 @@ else fi # Direkte LDAP-Abfrage mit den Daten aus sssd.conf: trennt Outpost-/Bind-Probleme von SSSD-Problemen -conf() { awk -F' *= *' -v k="$1" '$1 == k { print $2; exit }' /etc/sssd/sssd.conf 2>/dev/null; } +conf() { sed -n "s/^$1 *= *//p" /etc/sssd/sssd.conf 2>/dev/null | head -n 1; } # Wert darf selbst '=' enthalten (DN, Passwort) if command -v ldapsearch >/dev/null && [[ -r /etc/sssd/sssd.conf ]]; then echo "── ldapsearch (cn=$USER_NAME)" LDAPTLS_CACERT="$(conf ldap_tls_cacert)" ldapsearch -LLL -H "$(conf ldap_uri)" -D "$(conf ldap_default_bind_dn)" \