Containerize TPM Initialization tool
[aaf/sshsm.git] / bin / abrmdcontainer / run_abrmd.sh
1 #!/bin/bash
2 set -e
3
4 # Start DBUS
5 mkdir -p /var/run/dbus
6 stdbuf -oL -eL dbus-daemon --system --nofork 2>&1 1> /var/log/dbus-daemon.log &
7
8 # Start Resource Manager
9 if [ -z $TPM_SIMULATOR ]; then
10   echo "Using TPM Hardware for the operations";
11   tpm2-abrmd
12 else
13   echo "Using TPM Simulator for the opeations";
14   hostip=$(ip route show | awk '/default/ {print $3}');
15   echo "Connecting to $hostip\n";
16   tpm2-abrmd -a $hostip -t socket
17 fi