#!/bin/sh

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

MOUNTPOINTS=$(kdb complete system/elektra/mountpoints/ --max-depth=1)
MOUNTPOINTS=$(echo "$MOUNTPOINTS" | sed 's:system/elektra/mountpoints/::' | sed 's:\\/:/:g')
FILES=
OLD_IFS="$IFS"
IFS="$(printf '\n+')"
for mp in $MOUNTPOINTS;
do
    FILES="$FILES`$KDB file \"$mp\"`\n"
done
FILES="${FILES%??}"
FILES=$(echo "$FILES"|sort|uniq)
echo "$FILES"
IFS="$OLD_IFS"
