From: Ivan Rako Date: Thu, 21 Apr 2005 07:18:28 +0000 (+0000) Subject: r55: X-Git-Tag: debian/3.0.0~51 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=1f360eda34c38dfef45ad4d76ad13ca700185176;p=carnet-tools-cn.git r55: --- 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