diff --git a/bash/hetzner-rescue.sh b/bash/hetzner-rescue.sh index e5b18fa..c710da4 100644 --- a/bash/hetzner-rescue.sh +++ b/bash/hetzner-rescue.sh @@ -129,7 +129,7 @@ else fi } -function hetzner-rescue-wipe-12-10-10 { +function hetzner-rescue-wipe-12-10-10-0 { local device local devices=( '/dev/sdc' @@ -246,6 +246,33 @@ function hetzner-rescue-wipe-12-10-10 { # open echo "${passphrase}" \ | cryptsetup luksOpen '/dev/md/crypt' 'crypt' +#### + # close + cryptsetup luksClose 'crypt' +} + +function hetzner-rescue-wipe-12-10-10-1 { + local passphrase + # read passphrase + echo -n 'PassPhrase: ' + read -r -s passphrase + # encrypt + echo "${passphrase}" \ + | cryptsetup \ + --verbose \ + --batch-mode \ + --type 'luks2' \ + --pbkdf 'argon2id' \ + --cipher 'aes-xts-plain64' \ + --iter-time 8192 \ + --key-size 512 \ + --hash 'sha512' \ + --use-random \ + luksFormat \ + '/dev/md/crypt' + # open + echo "${passphrase}" \ + | cryptsetup luksOpen '/dev/md/crypt' 'crypt' # pv pvcreate '/dev/mapper/crypt' # vg