From a3f11eca9ef5ed853b85d552008b040f3c08dd5e Mon Sep 17 00:00:00 2001
From: Alex <apuret@takima.fr>
Date: Mon, 13 Dec 2021 16:56:24 +0100
Subject: [PATCH] feat: run startup script if exists

---
 start.sh | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/start.sh b/start.sh
index 4784e528..c45a9033 100755
--- a/start.sh
+++ b/start.sh
@@ -1,10 +1,25 @@
 #!/bin/sh
 
+ON_START_UP_FILE="/deadlock/startup.sh"
+TAG="[DEADLOCK]"
+
 # setup ssh key for root user
 # must be installed by the API first within /tmp/.ssh
 mkdir ~/.ssh
 cp /tmp/.ssh/* ~/.ssh/
 
+# start init mission script if exists
+if [ -f "$ON_START_UP_FILE" ]; then
+    echo
+    echo "$TAG Startup your script.."
+    echo
+    /bin/bash $ON_START_UP_FILE &
+else
+    echo
+    echo "$TAG No startup script found."
+    echo
+fi
+
 # start command recorder
 node deadlock/recorder.js &
 
@@ -14,4 +29,4 @@ su theia --command "python setup_trace.py"
 rm setup_trace.py
 
 # starting theia as THEIA
-su theia --command "node /home/theia/src-gen/backend/main.js /home/project --hostname=0.0.0.0 --plugins=local-dir:/home/plugins"
\ No newline at end of file
+su theia --command "node /home/theia/src-gen/backend/main.js /home/project --hostname=0.0.0.0 --plugins=local-dir:/home/plugins"
-- 
GitLab