aboutsummaryrefslogtreecommitdiffstats
path: root/bin/abrmdcontainer/run_abrmd.sh
blob: c4a492c9a443785e014614a54058489c44f1efaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
set -e

# Start DBUS
mkdir -p /var/run/dbus
rm -f /var/run/dbus/*
stdbuf -oL -eL dbus-daemon --system --nofork 2>&1 1> /var/log/dbus-daemon.log &
sleep 1m

# Start Resource Manager
if [ -z $TPM_SIMULATOR ]; then
  echo "Using TPM Hardware for the operations";
  tpm2-abrmd --allow-root
else
  echo "Using TPM Simulator for the opeations";
  hostip=$(ip route show | awk '/default/ {print $3}');
  echo "Connecting to $hostip\n";
  tpm2-abrmd -a $hostip -t socket
fi