summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src/scripts/template-dbverify.in
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2007-09-07 19:08:45 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2007-09-07 19:08:45 +0000
commit1676f9b5b6810403496c441a5545c9b361662f34 (patch)
tree60c218e6d9046286c39974a57a72022647bd129d /ldap/admin/src/scripts/template-dbverify.in
parentba217f8884cadc1b05dee3ca49201787be4983eb (diff)
downloadds-1676f9b5b6810403496c441a5545c9b361662f34.tar.gz
ds-1676f9b5b6810403496c441a5545c9b361662f34.tar.xz
ds-1676f9b5b6810403496c441a5545c9b361662f34.zip
Resolves: #236256
Summary: verify-db.pl (db_verify) does not work on a little endian machine (comment #1-#4) Description: 1) introducing dbverify mode to ns-slapd. 2) providing new script dbverify to call "ns-slapd dbverify" 3) fixing verify-db.pl to call dbverify instead of db_verify from BDB
Diffstat (limited to 'ldap/admin/src/scripts/template-dbverify.in')
-rwxr-xr-xldap/admin/src/scripts/template-dbverify.in42
1 files changed, 42 insertions, 0 deletions
diff --git a/ldap/admin/src/scripts/template-dbverify.in b/ldap/admin/src/scripts/template-dbverify.in
new file mode 100755
index 00000000..b5e56d9f
--- /dev/null
+++ b/ldap/admin/src/scripts/template-dbverify.in
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+prefix="{{DS-ROOT}}"
+if [ "$prefix" = "/" ] ; then
+ prefix=""
+fi
+LD_LIBRARY_PATH=$prefix/{{SERVER-DIR}}:$prefix@nss_libdir@:$prefix@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
+
+args=""
+while [ "$1" != "" ]
+do
+ if [ "$1" = "-n" ]; then
+ args=$args" "$1
+ shift
+ args=$args" "$1
+ elif [ "$1" = "-V" ]; then
+ args=$args" "$1
+ else
+ echo "Usage: dbverify [-n backend_instance] [-V]"
+ echo "Note : if \"-n backend_instance\" is not passed, verify all DBs."
+ echo " -V : verbose"
+ exit 1
+ fi
+ shift
+done
+
+
+cd {{SERVERBIN-DIR}}
+./ns-slapd dbverify -D {{CONFIG-DIR}} $args
+if [ $? -eq 0 ]; then
+ echo "DB verify: Passed"
+ exit 0
+else
+ echo "DB verify: Failed"
+ exit 1
+fi