mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-19 13:07:58 +00:00
23 lines
320 B
Bash
23 lines
320 B
Bash
|
#!/bin/sh
|
||
|
# get a file and extend a TPM PCR
|
||
|
|
||
|
die() {
|
||
|
echo >&2 "$@"
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
INDEX="$1"
|
||
|
URL="$2"
|
||
|
|
||
|
if [ -z "$INDEX" -o -z "$URL" ]; then
|
||
|
die "Usage: $0 pcr-index url"
|
||
|
fi
|
||
|
|
||
|
|
||
|
wget "$URL" || die "$URL: failed"
|
||
|
|
||
|
FILE="`basename "$URL"`"
|
||
|
tpm extend -ix "$INDEX" -if "$FILE" || die "$FILE: tpm extend failed"
|
||
|
|
||
|
|