00fbf24a7a7cd40d0267bbe5b593114b98ff5135
[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 rm -f /var/run/dbus/*
7 stdbuf -oL -eL dbus-daemon --system --nofork 2>&1 1> /var/log/dbus-daemon.log &
8 sleep 1m
9
10 # Start Resource Manager
11 if [ -z $TPM_SIMULATOR ]; then
12   echo "Using TPM Hardware for the operations";
13   tpm2-abrmd
14 else
15   echo "Using TPM Simulator for the opeations";
16   hostip=$(ip route show | awk '/default/ {print $3}');
17   echo "Connecting to $hostip\n";
18   tpm2-abrmd -a $hostip -t socket
19 fi