aboutsummaryrefslogtreecommitdiffstats
path: root/core/entrypoint.bash
diff options
context:
space:
mode:
Diffstat (limited to 'core/entrypoint.bash')
-rw-r--r--core/entrypoint.bash25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/entrypoint.bash b/core/entrypoint.bash
new file mode 100644
index 0000000..e2d15c1
--- /dev/null
+++ b/core/entrypoint.bash
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+if [ ! -f /root/.tmate.conf ]; then
+ cat > /root/.tmate.conf <<-EOF
+set -g mouse on
+set tmate-api-key "${API_KEY}"
+set tmate-session-name "${NAME_SESSION}"
+EOF
+fi
+
+while :; do
+ if pgrep -f tmate > /dev/null; then
+ sleep 3
+ else
+ # background
+ tmate -S /tmp/tmate.sock new-session -d &> /dev/null
+ tmate -S /tmp/tmate.sock wait tmate-ready
+
+ # show-messages
+ tmate -S /tmp/tmate.sock display -p "web session read only: #{tmate_web_ro}"
+ tmate -S /tmp/tmate.sock display -p "ssh session read only: #{tmate_ssh_ro}"
+ tmate -S /tmp/tmate.sock display -p "web session: #{tmate_web}"
+ tmate -S /tmp/tmate.sock display -p "ssh session: #{tmate_ssh}"
+ fi
+done