#!/usr/bin/env sh # CryptTab Open while read -r NAME DEV KEY OPTS; do if [ -f "${KEY}" ]; then cryptsetup open "${DEV}" "${NAME}" --key-file "${KEY}" else cryptsetup open "${DEV}" "${NAME}" fi done <<< $(grep -v '^#' /etc/crypttab | sed '/^[[:space:]]*$/d' | sed 's/[[:space:]]\{1,\}/\t/g' | sed 's|UUID=|/dev/disk/by-uuid/|g')