From 3972d3ce394278cfca3b10b971973db5648d279c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 3 Oct 2023 10:05:29 +0200 Subject: [PATCH] split --- bash/hetzner-rescue.sh | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) 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