#!/bin/sh
#
# @author Markus Raab <markus@libelektra.org>
# @brief Unmounts all (global) mountpoints
# @date 02.08.2019
# @tags umount, stash, helper

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

fail() {
	echo "$*" 1>&2
	exit 1
}

if [ "$1" != "-f" ]; then
	fail "This is a very dangerous operation, read the man page first"
fi

"$KDB" rm -rf system:/elektra/mountpoints
"$KDB" rm -rf system:/elektra/globalplugins
