>> +# Find out slapd db directories
>> +SLAPD_DBDIRS=`sed -ne 's/^directory[[:space:]]\+"*\([^"]\+\).*/\1/p' \
>> + "$SLAPD_CONF" `
>> +
TL> I'd rather gather this list at the time when it is needed. Apart from
TL> that I don't really grok that sed expression :)
It has only possible failure if path contains double quotes in it, which
is very unlikely situation. And this:
TL> +# Find bdb environment dirs
TL> +find_bdb_envs() {
TL> + local d
TL> + for d in `awk '/directory/ {print $2}' < "$SLAPD_CONF"`; do
TL> + if [ -d "$d" -a -f "$d/objectClass.bdb" ]; then
TL> + echo $d
TL> + fi
TL> + done
TL> +}
will happily skip entries like:
directory "/var/lib/ldap"
(note the quotes), which are by default in sarge install.
Hello Torsten.
On Thu, 26 May 2005 16:53:17 +0200
you wrote:
>> +# Find out slapd db directories [:space: ]]\+"*\ ([^"]\+ \).*/\1/ p' \
>> +SLAPD_DBDIRS=`sed -ne 's/^directory[
>> + "$SLAPD_CONF" `
>> +
TL> I'd rather gather this list at the time when it is needed. Apart from
TL> that I don't really grok that sed expression :)
It has only possible failure if path contains double quotes in it, which
is very unlikely situation. And this:
TL> +# Find bdb environment dirs .bdb" ]; then
TL> +find_bdb_envs() {
TL> + local d
TL> + for d in `awk '/directory/ {print $2}' < "$SLAPD_CONF"`; do
TL> + if [ -d "$d" -a -f "$d/objectClass
TL> + echo $d
TL> + fi
TL> + done
TL> +}
will happily skip entries like:
directory "/var/lib/ldap"
(note the quotes), which are by default in sarge install.