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
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