#!/bin/sh
#
# @author Thomas Waser <thomas.waser@libelektra.org>
# @brief Stashes away the current KDB to be restored later.
# @date 14.08.2017
# @tags backup, stash, helper

if [ -z "$KDB" ]; then
	KDB=kdb
fi

fail() {
	echo "$*" 2> /dev/null
	exit 1
}

"$KDB" backup || fail "Could not backup successfully, will abort"

"$KDB" reset -f
