diff options
author | Girish Havaldar <hg0071052@techmahindra.com> | 2018-09-27 08:22:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-09-27 08:22:00 +0000 |
commit | c73fe640cbe1e7a0aef0cdfcabe3759544f21ca4 (patch) | |
tree | 947e4d9963426f4fd1d814784552fbda34bae290 /bin/base/abrmd_ready.sh | |
parent | e19f78e89aaa94bbf3e0c612314d48c9672ad5c3 (diff) | |
parent | dd4e9db0294f028f7ebc465238a848f75ea3c06a (diff) |
Merge "Add abrmd readiness check script to base"
Diffstat (limited to 'bin/base/abrmd_ready.sh')
-rwxr-xr-x | bin/base/abrmd_ready.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/base/abrmd_ready.sh b/bin/base/abrmd_ready.sh new file mode 100755 index 0000000..37fe541 --- /dev/null +++ b/bin/base/abrmd_ready.sh @@ -0,0 +1,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 |