3
source @datadir@/@package_name@/data/DSSharedLib
5
libpath_add "@libdir@/@package_name@/"
6
libpath_add "@nss_libdir@"
8
libpath_add "@pcre_libdir@"
10
export LD_LIBRARY_PATH
11
SHLIB_PATH=$LD_LIBRARY_PATH
16
echo "Usage: ldif2db [-Z serverID] -n backendname {-s includesuffix}* [{-x excludesuffix}*] {-i ldiffile}*"
17
echo " [-c chunksize] [-g [string]] [-G namespace_id] [-O] [-E] [-q] [-v] [-h]"
18
echo "Note: either \"-n backend\", \"-s includesuffix\", and \"-i ldiffile\" are required."
20
echo " -Z serverID - The server instance identifier"
21
echo " -n backend - Backend database name. Example: userRoot"
22
echo " -s inclduesuffix - Suffix to include"
23
echo " -x excludesuffix - Suffix to exclude"
24
echo " -i ldiffile - LDIF file name"
25
echo " -c chunksize - Number of entries to process before starting a new pass"
26
echo " -g [string] - String is \"none\" or \"deterministic\""
27
echo " \"none\" - unique id is not generated"
28
echo " \"deterministic\" - generate name based unique id (-G name)"
29
echo " By default - generate time based unique id"
30
echo " -G name - Namespace id for name based uniqueid (-g deterministic)"
31
echo " -O - Do not index the attributes"
32
echo " -E - Encrypt attributes"
33
echo " -q - Quiet mode - suppresses output"
34
echo " -v - Verbose output"
35
echo " -h - Display usage"
42
if [ "$1" = "-q" ]; then
44
elif [ "$1" = "-Z" ]; then
47
elif [ "$1" = "-h" ]; then
56
while getopts "Z:vhd:i:g:G:n:s:x:NOCc:St:D:Eq" flag
62
n) args=$args" -n $OPTARG";;
63
i) args=$args" -i $OPTARG";;
64
s) args=$args" -s $OPTARG";;
65
x) args=$args" -x $OPTARG";;
66
c) args=$args" -c $OPTARG";;
67
d) args=$args" -d $OPTARG";;
68
g) args=$args" -g $OPTARG";;
69
G) args=$args" -G $OPTARG";;
70
t) args=$args" -t $OPTARG";;
71
D) args=$args" -D $OPTARG";;
84
initfile=$(get_init_file "@initconfigdir@" $servid)
88
echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
89
echo "Available instances: $initfile"
103
if [ $quiet -eq 0 ]; then
104
echo importing data ...
107
@sbindir@/ns-slapd ldif2db -D $CONFIG_DIR $args 2>&1