predradnje, od \fB. /usr/share/debconf/confmodule\fR nadalje.\r
.TP\r
\fBcp_get_ldap_suffix\fR\r
-Funkcija vraca LDAP suffix kojeg cita iz \fI/etc/ldap/slapd.conf\fR.\r
+Funkcija vraca LDAP suffix kojeg cita iz \fI/etc/ldap/slapd.d/\fR.\r
.TP\r
\fBcp_get_ldap_realm\fR\r
-Funkcija vraca LDAP realm kojeg cita iz \fI/etc/ldap/slapd.conf\fR.\r
+Funkcija vraca LDAP realm kojeg cita iz \fI/etc/ldap/slapd.d/\fR.\r
.TP\r
\fBcp_get_mx_domain\fR\r
Funkcija vraca najopcenitiju domenu ciji MX zapis pokazuje\r
fi
}
-# by ico, Wed, 20 Apr 2005 21:09:54 +0200
+# by ico, Wed, 07 Dec 2011 13:30:02 +0100
cp_get_ldap_suffix() {
[ "$CP_SCRIPT_DEBUG" ] && set -vx
# but preserving initial state so it could be used afterwards
CP_ECHO_RETURN=""
- if [ ! -f /etc/ldap/slapd.conf ]; then
- echo "cp_get_ldap_suffix: /etc/ldap/slapd.conf: No such file" >&2
+ if [ ! -d /etc/ldap/slapd.d/ ]; then
+ echo "cp_get_ldap_suffix: /etc/ldap/slapd.d/: No such directory" >&2
return 2
fi
- RET="`awk '/^suffix/ { exit }
- END { gsub(/"/, "", $2); print $2 }' \
- < /etc/ldap/slapd.conf`"
+ #RET="`awk '/^suffix/ { exit }
+ # END { gsub(/"/, "", $2); print $2 }' \
+ # < /etc/ldap/slapd.conf`"
+
+ RET="`grep -r olcSuffix /etc/ldap/slapd.d/|awk '{print $2}'`"
if [ "`echo $RET | sed 's/,/ /g' | wc -w`" -gt 2 ]; then
RET=""
- echo "cp_get_ldap_suffix: Invalid LDAP suffix in /etc/ldap/slapd.conf" >&2
+ echo "cp_get_ldap_suffix: Invalid LDAP suffix in /etc/ldap/slapd.d/" >&2
return 2
fi
+
- [ -z "$RET" ] && echo "cp_get_ldap_suffix: No LDAP suffix in /etc/ldap/slapd.conf" >&2
+ [ -z "$RET" ] && echo "cp_get_ldap_suffix: No LDAP suffix in /etc/ldap/slapd.d/" >&2
[ -z "$echo_return" ] || echo $RET
CP_ECHO_RETURN="$echo_return"
}
# but preserving initial state so it could be used afterwards
CP_ECHO_RETURN=""
- if [ ! -f /etc/ldap/slapd.conf ]; then
- echo "cp_get_ldap_realm: /etc/ldap/slapd.conf: No such file" >&2
+ if [ ! -f /etc/ldap/slapd.d/ ]; then
+ echo "cp_get_ldap_realm: /etc/ldap/slapd.d/: No such directory" >&2
return 2
fi
cp_get_ldap_suffix || true
RET="`echo $RET | 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 "$RET" ] && echo "cp_get_ldap_realm: No LDAP REALM in /etc/ldap/slapd.d/" >&2
+ [ -z "$echo_return" ] || echo $RET
+ CP_ECHO_RETURN="$echo_return"
}
# if fqdn is name.dom3.dom2.dom1.hr, check if this host is MX for