diff --git a/src/zlevis b/src/zlevis index 8f3eb7a..34acddc 100755 --- a/src/zlevis +++ b/src/zlevis @@ -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