summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src/scripts/template-restoreconfig.in
blob: dc210cba1bfeaebad585342374b743fa73aafc95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

prefix="{{DS-ROOT}}"
LD_LIBRARY_PATH=$prefix/{{SERVER-DIR}}:$prefix@nss_libdir@:$prefix@libdir@:@nss_libdir@
export LD_LIBRARY_PATH
SHLIB_PATH=$prefix/{{SERVER-DIR}}:$prefix@nss_libdir@:$prefix@libdir@:@nss_libdir@
export SHLIB_PATH

cd {{SERVERBIN-DIR}}
conf_ldif=`ls -1t {{BAK-DIR}}/{{SERV-ID}}-*.ldif | head -1`
if [ -z "$conf_ldif" ]
then
    echo No configuration to restore in {{BAK-DIR}} ; exit 1
fi
echo Restoring $conf_ldif
./ns-slapd ldif2db -D {{CONFIG-DIR}} -i $conf_ldif -n NetscapeRoot 2>&1
exit $?