git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/aux/block-inventory
blob: c8dc3f3090fcc119410acdeb414b644ee5e0566c (plain)
1
2
3
4
5
6
7
8
9
10
#!/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."