This commit is contained in:
Marc Beninca 2024-11-29 19:18:30 +01:00
parent d590bfda0c
commit 4335005aac
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,10 +1,10 @@
sh_list_block_devices() { rwx_list_block_devices() {
lsblk \ lsblk \
--noempty \ --noempty \
--output "NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINTS" --output "NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINTS"
} }
sh_not() { rwx_not() {
case "${1}" in case "${1}" in
"false") echo "true" ;; "false") echo "true" ;;
"true") echo "false" ;; "true") echo "false" ;;
@ -12,11 +12,11 @@ sh_not() {
esac esac
} }
sh_read_passphrase() { rwx_read_passphrase() {
sh_read_secret "PassPhrase: " rwx_read_secret "PassPhrase: "
} }
sh_read_secret() { rwx_read_secret() {
local prompt="${1}" local prompt="${1}"
local secret local secret
printf "%s" "${prompt}" 1>&2 printf "%s" "${prompt}" 1>&2
@ -28,10 +28,10 @@ sh_read_secret() {
unset secret unset secret
} }
sh_warn_wipe() { rwx_warn_wipe() {
local tmp local tmp
sh_list_block_devices rwx_list_block_devices
printf "%s" "WIPE ${*} /?\\ OR CANCEL /!\\" printf "%s" "WIPE ${*} /?\\ OR CANCEL /!\\"
read -r tmp read -r tmp
sh_log_trace "${tmp}" rwx_log_trace "${tmp}"
} }