summaryrefslogtreecommitdiff
path: root/populate-ldap/10c-run-vlv-index-tasks.sh
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-23 13:50:15 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-23 13:50:15 (GMT)
commit811f83ace1e63d493093dff78151e9a64d90cf53 (patch)
treef3dde9326fdc7b4d3592f46c95bf687915ed4513 /populate-ldap/10c-run-vlv-index-tasks.sh
parentbe3183ea867ad6fe909e9684b45d6e3667cf2ede (diff)
downloadkolab-scripts-811f83ace1e63d493093dff78151e9a64d90cf53.tar.gz
Add the kolab-scripts used in migration and development
Diffstat (limited to 'populate-ldap/10c-run-vlv-index-tasks.sh')
-rwxr-xr-xpopulate-ldap/10c-run-vlv-index-tasks.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/populate-ldap/10c-run-vlv-index-tasks.sh b/populate-ldap/10c-run-vlv-index-tasks.sh
new file mode 100755
index 0000000..31fd2ca
--- /dev/null
+++ b/populate-ldap/10c-run-vlv-index-tasks.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+ . ./settings.sh
+
+(
+ echo "dn: cn=${domain_db} People VLV Index,cn=index,cn=tasks,cn=config"
+ echo "objectclass: top"
+ echo "objectclass: extensibleObject"
+ echo "cn: ${domain_db} People VLV Index"
+ echo "nsinstance: ${domain_db}"
+ echo "nsIndexVLVAttribute: People VLV Index"
+ echo ""
+) | ldapmodify -a -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}" -c
+
+ldap_complete=0
+
+while [ ${ldap_complete} -ne 1 ]; do
+ result=$(
+ ldapsearch \
+ -x \
+ -h ${ldap_host} \
+ -D "${ldap_binddn}" \
+ -w "${ldap_bindpw}" \
+ -c \
+ -LLL \
+ -b "cn=${domain_db} People VLV Index,cn=index,cn=tasks,cn=config" \
+ -s base 2>/dev/null
+ )
+ if [ -z "$result" ]; then
+ ldap_complete=1
+ echo ""
+ else
+ echo -n "."
+ sleep 1
+ fi
+done
+
+(
+ echo "dn: cn=${domain_db} Groups VLV Index,cn=index,cn=tasks,cn=config"
+ echo "objectclass: top"
+ echo "objectclass: extensibleObject"
+ echo "cn: ${domain_db} Groups VLV Index"
+ echo "nsinstance: ${domain_db}"
+ echo "nsIndexVLVAttribute: Groups VLV Index"
+ echo ""
+) | ldapmodify -a -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}" -c
+
+ldap_complete=0
+
+while [ ${ldap_complete} -ne 1 ]; do
+ result=$(
+ ldapsearch \
+ -x \
+ -h ${ldap_host} \
+ -D "${ldap_binddn}" \
+ -w "${ldap_bindpw}" \
+ -c \
+ -LLL \
+ -b "cn=${domain_db} Groups VLV Index,cn=index,cn=tasks,cn=config" \
+ -s base 2>/dev/null
+ )
+ if [ -z "$result" ]; then
+ ldap_complete=1
+ echo ""
+ else
+ echo -n "."
+ sleep 1
+ fi
+done
+
+