tpm2_ptool Shell-Skript zum Erstellen eines Primary, falls es noch nicht existiert
Das folgende Shell-Skript prüft, ob ein Primary-Objekt im TPM existiert. Falls nicht, initialisiert es das TPM mit tpm2_ptool init. Wenn bereits ein Primary existiert, gibt es einfach eine Meldung aus, die dies anzeigt.
Es spielt keine Rolle, ob eines oder mehrere Primaries existieren; das Skript initialisiert nur, wenn keine gefunden werden.
ensure_tpm_primary.sh
if [ -z "$(tpm2_ptool listprimaries)" ]; then
tpm2_ptool init
else
echo "Primary already exists"
fiCheck out similar posts by category:
Cryptography
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow