aboutsummaryrefslogtreecommitdiffstats
path: root/bin/base/abrmd_ready.sh
blob: 37fe54102a8d9c824bd10e9fe2def54ec2de2593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# Script to check if abrmd is ready
# This will be called in initContainers in Kubernetes
# Takes a seconds parameter that will time out the script

timeout=$1
start=$SECONDS
tpm2_listpcrs -T tabrmd >/dev/null
ret=$?

while [ $ret -ne 0 ]
do
  if (($SECONDS-$start > $timeout))
  then
    echo "$0 timed out after $timeout seconds"
    break
  fi

  sleep 10
  tpm2_listpcrs -T tabrmd >/dev/null
  ret=$?
done