util
This commit is contained in:
parent
d590bfda0c
commit
4335005aac
1 changed files with 8 additions and 8 deletions
16
sh/util.sh
16
sh/util.sh
|
@ -1,10 +1,10 @@
|
|||
sh_list_block_devices() {
|
||||
rwx_list_block_devices() {
|
||||
lsblk \
|
||||
--noempty \
|
||||
--output "NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINTS"
|
||||
}
|
||||
|
||||
sh_not() {
|
||||
rwx_not() {
|
||||
case "${1}" in
|
||||
"false") echo "true" ;;
|
||||
"true") echo "false" ;;
|
||||
|
@ -12,11 +12,11 @@ sh_not() {
|
|||
esac
|
||||
}
|
||||
|
||||
sh_read_passphrase() {
|
||||
sh_read_secret "PassPhrase: "
|
||||
rwx_read_passphrase() {
|
||||
rwx_read_secret "PassPhrase: "
|
||||
}
|
||||
|
||||
sh_read_secret() {
|
||||
rwx_read_secret() {
|
||||
local prompt="${1}"
|
||||
local secret
|
||||
printf "%s" "${prompt}" 1>&2
|
||||
|
@ -28,10 +28,10 @@ sh_read_secret() {
|
|||
unset secret
|
||||
}
|
||||
|
||||
sh_warn_wipe() {
|
||||
rwx_warn_wipe() {
|
||||
local tmp
|
||||
sh_list_block_devices
|
||||
rwx_list_block_devices
|
||||
printf "%s" "WIPE ${*} /?\\ OR CANCEL /!\\"
|
||||
read -r tmp
|
||||
sh_log_trace "${tmp}"
|
||||
rwx_log_trace "${tmp}"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue