1 # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
2 # vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
4 HELPERS="$HELPERS ldap:ldap_database_backup"
8 checkBox "ldap action wizard" "check options (slapcat OR ldapsearch)" \
9 "slapcat" "export ldif using slapcat" yes \
10 "ldapsearch" "export ldif using ldapsearch" no \
11 "compress" "compress the ldif output files" yes \
12 "ssl" "use SSL (deprecated)" no \
13 "tls" "use TLS extended operations (RFC2246, RFC2830)" yes
15 compress="compress = no"
16 method="method = <unset>"
17 restart="restart = no"
22 [ $status = 1 ] && return;
24 for opt in $result; do
26 '"compress"') compress="compress = yes";;
28 method="method = slapcat"
29 [ "$_RESTART" == "yes" ] && restart="restart = yes"
32 method="method = ldapsearch"
33 inputBox "ldap action wizard" "ldapsearch requires authentication. Specify here what password file to use. It must have the password with no trailing return and it should not be world readable."
35 passwordfile="passwordfile = $REPLY"
36 inputBox "ldap action wizard" "ldapsearch requires authentication. Specify here what DN to bind as:"
38 binddn="binddn = $REPLY"
39 require_packages ldap-utils
41 '"ssl"') ssl="ssl = yes";;
42 '"tls"') tls="tls = yes";;
45 get_next_filename $configdirectory/30.ldap
46 cat > $next_filename <<EOF
54 # backupdir = /var/backups/ldap
55 # conf = /etc/ldap/slapd.conf
58 chmod 600 $next_filename
67 for backend in `grep -e "^backend" /etc/ldap/slapd.conf | @AWK@ '{print $2}'`; do
68 if [ "$backend" == "bdb" ]; then
70 elif [ "$backend" == "hdb" ]; then
72 elif [ "$backend" == "ldbm" ]; then
77 if [ "$bdb" == "yes" -o "$hdb" == "yes" ]; then
78 if [ "$ldbm" == "no" ]; then
79 msgBox "ldap action wizard" "It looks like the backend in your slapd.conf is set to BDB or HDB. If this is not the case, exit this wizard! From this point on, we will assume BDB or HDB backend, which might have disasterious consequences if this is incorrect."
83 elif [ "$ldbm" == "yes" ]; then
84 msgBox "ldap action wizard" "It looks like the backend in your slapd.conf is set to LDBM. Because of this, you will have less options (because it is not safe to use slapcat while slapd is running LDBM)."
88 msgBox "ldap action wizard" "I couldn't find any supported backend in your slapd.conf. Bailing out."