From 00d6d904dc26592553ba93710c205603757e3faf Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 3 Jun 2015 21:13:10 +0200 Subject: Configure Bacula File Daemon / Storage Daemon / Director. Using client-side data signing/encryption and wrapping inter-host communication into stunnel. --- roles/common-LDAP/files/usr/local/sbin/slapcat-all.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 roles/common-LDAP/files/usr/local/sbin/slapcat-all.sh (limited to 'roles/common-LDAP/files') diff --git a/roles/common-LDAP/files/usr/local/sbin/slapcat-all.sh b/roles/common-LDAP/files/usr/local/sbin/slapcat-all.sh new file mode 100755 index 0000000..4e5b5e4 --- /dev/null +++ b/roles/common-LDAP/files/usr/local/sbin/slapcat-all.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Usage: slapcat-all.sh DIR +# Save all LDAP databases in DIR: DIR/0.ldif, DIR/1.ldif, ... + +set -ue +PATH=/usr/sbin:/sbin:/usr/bin:/bin + +target="$1" +umask 0077 + +slapcat -n0 -l"$target/0.ldif" +n=$(grep -Ec '^dn:\s+olcDatabase={[1-9][0-9]*}' "$target/0.ldif") + +while [ $n -gt 0 ]; do + slapcat -n$n -l"$target/$n.ldif" + n=$(( $n - 1 )) +done -- cgit v1.2.3