From 213f6ae1f15b19e11880429f122ffcb238dd3fc9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 16 Nov 2024 13:22:55 +0100 Subject: [PATCH] warn_wipe --- shell/rescue/hetzner.sh | 6 ++---- shell/rescue/ovh.sh | 4 +--- shell/util.sh | 8 ++++++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/shell/rescue/hetzner.sh b/shell/rescue/hetzner.sh index 05e12d5..b14d5c7 100644 --- a/shell/rescue/hetzner.sh +++ b/shell/rescue/hetzner.sh @@ -10,10 +10,8 @@ rescue_wipe_0_init_hetzner_8_8() { local passphrase # read passphrase passphrase="$(read_passphrase)" - # - lsblk - printf "%s" "WIPE ${*} /?\\ OR CANCEL /!\\" - read -r + # warn + warn_wipe "${@}" # number=0 for device in "${@}"; do diff --git a/shell/rescue/ovh.sh b/shell/rescue/ovh.sh index ed225d1..b12c50b 100644 --- a/shell/rescue/ovh.sh +++ b/shell/rescue/ovh.sh @@ -4,9 +4,7 @@ rescue_wipe_0_init_ovh_vle2() { # read passphrase passphrase="$(read_passphrase)" # warn - lsblk - printf "%s" "WIPE ${device} /?\\ OR CANCEL /!\\" - read -r + warn_wipe "${device}" # parted --script "${device}" \ mktable gpt \ diff --git a/shell/util.sh b/shell/util.sh index 8a345ba..7d333ae 100644 --- a/shell/util.sh +++ b/shell/util.sh @@ -21,3 +21,11 @@ read_secret() { echo "${secret}" unset secret } + +warn_wipe() { + local tmp + lsblk --noempty + printf "%s" "WIPE ${*} /?\\ OR CANCEL /!\\" + read -r tmp + log_trace "${tmp}" +}