src/zlevis: removed key option indefinitely

This commit is contained in:
Luc Bijl 2025-02-19 21:14:25 +01:00
parent 5b914c13a3
commit 1b067ff34c

View file

@ -36,28 +36,13 @@ encrypt_pool_info() {
# Determine the argument path and execute the relevant script or function
if [ -t 0 ]; then
case "$1" in
"decrypt")
case "$2" in
"pool") zfs list -Ho tpm:jwe "$3" | zlevis-decrypt;;
*) info;;
esac
;;
"encrypt")
case "$2" in
"pool") encrypt_pool_info;;
*) info;;
esac
;;
"decrypt") zfs list -Ho tpm:jwe "$2" | zlevis-decrypt;;
"encrypt") encrypt_pool_info;;
*) info;;
esac
else
case "$1" in
"encrypt")
case "$2" in
"pool") read -r -d . key || zfs set tpm:jwe=$(printf "%s" "$key" | zlevis-encrypt "$4") "$3";;
*) info;;
esac
;;
"encrypt") read -r -d . key || zfs set tpm:jwe=$(printf "%s" "$key" | zlevis-encrypt "$3") "$2";;
*) info;;
esac
fi