check-sshd-ldap.sh: conf() schnitt Werte mit '=' ab (DN/Passwort) – per sed statt awk
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e19b02dfbd
commit
ba23d5bcc3
1 file changed
+1
-1
+1
-1
@@ -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)" \
|
||||
|
||||
Reference in new issue
Block a user