src/zlevis*: rename and add versioning

Renamed zlevis binaries for versioning capability with meson.
This commit is contained in:
Luc Bijl 2025-11-08 11:58:41 +01:00
parent d415066add
commit 55c25299da
3 changed files with 32 additions and 5 deletions

View file

@ -3,10 +3,13 @@
# Exit immediately if a command exits with a non-zero status
set -e
# Summary of the script's functionality
# Summary of the functionality of zlevis-decrypt
summary="Decrypts a JWE using a TPM2.0 chip"
# TPM2.0 owner hierarchy to be used by the Operating System
# Version of zlevis
version="@VERSION@"
# TPM2.0 owner hierarchy to be used by the operating system
auth="o"
# Display summary if requested
@ -15,6 +18,12 @@ if [ "$1" = "--summary" ]; then
exit 0
fi
# Display version if requested
if [ "$1" = "--version" ]; then
echo "$version"
exit 0
fi
# Display usage information if input is from a terminal
if [ -t 0 ]; then
exec >&2

View file

@ -3,9 +3,12 @@
# Exit immediately if a command exits with a non-zero status
set -e
# Summary of the script's functionality
# Summary of the functionality of zlevis-encrypt
summary="Encrypts using a TPM2.0 chip binding policy"
# Version of zlevis
version="@VERSION@"
# TPM2.0 owner hierarchy to be used by the Operating System
auth="o"
@ -18,6 +21,12 @@ if [ "$1" = "--summary" ]; then
exit 0
fi
# Display version if requested
if [ "$1" = "--version" ]; then
echo "$version"
exit 0
fi
# Display usage information if input is from a terminal
if [ -t 0 ]; then
exec >&2

View file

@ -3,15 +3,24 @@
# Exit immediately if a command exits with a non-zero status
set -e
# Summary of the script's functionality
# Summary of the functionality of zlevis
summary="A tool that enables automatic decryption of ZFS rpools with TPM2"
# Version of zlevis
version="@VERSION@"
# Display summary if requested
if [ "$1" = "--summary" ]; then
echo "$summary"
exit 0
fi
# Display version if requested
if [ "$1" = "--version" ]; then
echo "$version"
exit 0
fi
# Function to display usage information of zlevis
info() {
exec >&2
@ -48,4 +57,4 @@ else
fi
# Exit with the status of the last command
exit $?
exit $?