2015-08-03 11:40:50 -04:00
|
|
|
ensure_tpm_path_exists() {
|
|
|
|
mkdir -p "$(tpm_path)"
|
|
|
|
}
|
|
|
|
|
2025-01-09 19:34:51 -05:00
|
|
|
verify_tpm_path_permissions() {
|
|
|
|
local path="$(tpm_path)"
|
|
|
|
# check the write permission flag for all users to ensure
|
|
|
|
# that we have proper access
|
|
|
|
[ -w "$path" ] ||
|
|
|
|
echo_err "$path is not writable!"
|
|
|
|
}
|
|
|
|
|
2015-08-03 11:40:50 -04:00
|
|
|
fail_helper() {
|
|
|
|
local message="$1"
|
|
|
|
echo "$message" >&2
|
|
|
|
FAIL="true"
|
|
|
|
}
|
|
|
|
|
|
|
|
exit_value_helper() {
|
|
|
|
if [ "$FAIL" == "true" ]; then
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
}
|