Script shell tpm2_ptool pour créer un primary s'il n'existe pas encore
Le script shell suivant vérifie si un objet primary existe dans le TPM. Si ce n’est pas le cas, il initialise le TPM avec tpm2_ptool init. Si un primary existe déjà, il se contente d’afficher un message l’indiquant.
Peu importe si un ou plusieurs primaries existent ; le script n’initialisera que si aucun n’est trouvé.
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