summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src/scripts/template-ldif2db.in
blob: ce64193afc41ee5e8c90456eb56e3066c432048c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

prefix="{{DS-ROOT}}"
if [ "$prefix" = "/" ] ; then
    prefix=""
fi
LD_LIBRARY_PATH=$prefix/{{SERVER-DIR}}:$prefix@nss_libdir@:$prefix@libdir@:$prefix@pcre_libdir@
if [ -n "$prefix" ] ; then
    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@nss_libdir@"
fi
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH

cd {{SERVERBIN-DIR}}
if [ $# -lt 4 ]
then
	echo "Usage: ldif2db -n backend_instance | {-s includesuffix}* [{-x excludesuffix}*]"
	echo "               {-i ldiffile}* [-O]"
	echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" and \"-i ldiffile\" are required."
	exit 1
fi

echo importing data ...
./ns-slapd ldif2db -D {{CONFIG-DIR}} "$@" 2>&1
exit $?