summaryrefslogtreecommitdiffstats
path: root/bin/abrmdcontainer/run_abrmd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/abrmdcontainer/run_abrmd.sh')
-rwxr-xr-xbin/abrmdcontainer/run_abrmd.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/abrmdcontainer/run_abrmd.sh b/bin/abrmdcontainer/run_abrmd.sh
new file mode 100755
index 0000000..bcfb233
--- /dev/null
+++ b/bin/abrmdcontainer/run_abrmd.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -e
+
+# Start DBUS
+mkdir -p /var/run/dbus
+stdbuf -oL -eL dbus-daemon --system --nofork 2>&1 1> /var/log/dbus-daemon.log &
+
+# Start Resource Manager
+if [ -z $TPM_SIMULATOR ]; then
+ echo "Using TPM Hardware for the operations";
+ tpm2-abrmd
+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