Skip mdb_stat test when the command is not available

This commit is contained in:
Viktor Dukhovni
2017-03-09 18:10:10 -05:00
committed by Viktor Dukhovni
parent a39bd42576
commit 2baa0a00c8

View File

@@ -446,13 +446,13 @@ ${iprop_log} last-version > slave-last.tmp
${iprop_log} last-version > master-last.tmp
cmp master-last.tmp slave-last.tmp || exit 1
if [ "$db_type" = lmdb ]; then
if [ "$db_type" = lmdb ] && type mdb_stat > /dev/null 2>&1; then
# Sanity check that we have the same number of principals at the HDB
# and LMDB levels.
#
# We should also do this for the sqlite backend, but that would
# require a sqlite3(1) shell that is capable of opening our HDB
# files. W
# files.
echo "checking that principals in DB == entries in LMDB"
princs=`${kadmin} -l list '*' | wc -l`
entries=`mdb_stat -n current-db.mdb | grep 'Entries:' | awk '{print $2}'`