#!/bin/sh if ! [ "$(id -u)" -eq 0 ]; then echo "Not root. Use: sudo $(basename $0)" exit 1 fi cryptsetup luksChangeKey $(cryptsetup status $(lvdisplay -m $(findmnt -vn -o SOURCE -T /)|grep "Physical volume"|awk '{print $3}')|grep device|awk '{print $2}')