summaryrefslogtreecommitdiffstats
path: root/docker/setupEnv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/setupEnv.sh')
-rwxr-xr-xdocker/setupEnv.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/docker/setupEnv.sh b/docker/setupEnv.sh
new file mode 100755
index 0000000..bb32952
--- /dev/null
+++ b/docker/setupEnv.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+DBUS_FILE=/root/dbus.env
+
+if [ "$SBC_DIR" == "" ]; then
+ echo "SBC_DIR not set"
+ exit 1
+fi
+
+if [ -f $DBUS_FILE ]; then
+ echo "Already initialized."
+ . $DBUS_FILE
+else
+ dbus-launch --sh-syntax > $DBUS_FILE
+ . $DBUS_FILE
+
+ mkdir -p $SBC_DIR
+
+ # create symlink for service files that autostarts the single binaries
+ mkdir -p /root/.local/share/dbus-1
+ if [[ ! -d /root/.local/share/dbus-1/services ]]; then
+ ln -s $SBC_DIR/dbus /root/.local/share/dbus-1/services
+ fi
+fi