#!/bin/bash

SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$SCDIR/ctrl-c"||exit 1
ODETFIL="$SCDIR/../blockdevices"

echo -n "Fetching blocks..."
true>"$ODETFIL";[ "$?" -ne 0 ]&&echo "failed."&&exit 1||echo -n "."
echo -n ".";lsblk -im -o+FSTYPE,MIN-IO,MOUNTPOINT 2>/dev/null|sed 's/luks-[^\ ]\+/luks-<uuid>                              /g' >"$ODETFIL"
[ "$?" -ne 0 ]&&echo ".failed."||echo ".done."