From 1f360eda34c38dfef45ad4d76ad13ca700185176 Mon Sep 17 00:00:00 2001 From: Ivan Rako Date: Thu, 21 Apr 2005 07:18:28 +0000 Subject: [PATCH] r55: --- functions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions.sh b/functions.sh index c461a50..d94cc14 100644 --- a/functions.sh +++ b/functions.sh @@ -333,7 +333,7 @@ cp_get_ldap_suffix() { return 1 fi - RET="`awk /^suffix/'{print $2}' /etc/ldap/slapd.conf | head -1 | tr -d '"'`" + RET="`awk '/^suffix/{exit}END{gsub(/"/, "", $2); print $2}' /etc/ldap/slapd.conf`" [ -z "$RET" ] && echo "cp_get_ldap_suffix: No LDAP suffix in /etc/ldap/slapd.conf" >&2 [ -z "$echo_return" ] || echo $RET @@ -355,7 +355,8 @@ cp_get_ldap_realm() { return 1 fi - RET="`awk /^suffix/'{print $2}' /etc/ldap/slapd.conf | head -1 | tr -d '"' | awk -F, '{print $1}' | awk -F= '{print $2}'`" + RET="`awk '/^suffix/{exit}END{gsub(/"/, "", $2); print $2}' \ + /etc/ldap/slapd.conf | awk -F, '{print $1}' | awk -F= '{print $2}'`" [ -z "$RET" ] && echo "cp_get_ldap_realm: No LDAP REALM in /etc/ldap/slapd.conf" >&2 [ -z "$echo_return" ] || echo $RET -- 1.7.10.4