7e310da296875f1299f47de70f4e019bf7a27377
4 # this script is idempotent
6 if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi
7 shopt -s inherit_errexit
2>/dev
/null ||
: # ignore fail in bash < 4.4
9 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
11 m
() { printf "%s\n" "$*"; "$@"; }
14 lvs
--noheadings -o vg_name
,lv_name |
while read -r vg lv
; do
15 if [[ ! $vg ||
! $lv ]]; then
18 if ! integritysetup dump
/dev
/$vg/$lv &>/dev
/null
; then
21 int_name
=integrity-
$vg-$lv
22 if integritysetup status
$int_name &>/dev
/null
; then
25 m integritysetup open
--allow-discards /dev
/$vg/$lv $int_name
28 awk '$1 !~ /^ *#/ {print $1}' /etc
/crypttab |
while read -r c
; do