src/zlevis: specified options
This commit is contained in:
parent
44e6d7efd0
commit
f022b1fe3c
1 changed files with 6 additions and 4 deletions
10
src/zlevis
10
src/zlevis
|
@ -15,21 +15,23 @@ fi
|
|||
# Display usage information if input is from a terminal
|
||||
if [ -t 0 ]; then
|
||||
exec >&2
|
||||
echo "Usage: zlevis {decrypt|encrypt} {pool|*} [options]"
|
||||
echo "Usage: \"zlevis {decrypt|encrypt} {pool|key} [options]\""
|
||||
exit 2
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
decrypt)
|
||||
case "$2" in
|
||||
case "$2" in
|
||||
pool) zfs list -Ho tpm:jwe $3 | zlevis-decrypt;;
|
||||
*) zlevis-decrypt $2;;
|
||||
key) zlevis-decrypt;;
|
||||
*) exit 1;;
|
||||
esac
|
||||
;;
|
||||
encrypt)
|
||||
case "$2" in
|
||||
pool) read -r -d . key || zfs set tpm:jwe=$(printf "%s" "$key" | zlevis-encrypt $4) $3;;
|
||||
*) zlevis-encrypt $2;;
|
||||
key) zlevis-encrypt $3;;
|
||||
*) exit 1;;
|
||||
esac
|
||||
;;
|
||||
*) exit 1;;
|
||||
|
|
Loading…
Reference in a new issue