Skip to content

Commit 6b22a7e

Browse files
authored
Merge pull request #29 from coollabsio/27-investigate-openclaw-docker
fix(entrypoint): improve custom init script handling and permissions
2 parents 1d95c56 + 67392c8 commit 6b22a7e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/entrypoint.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,15 @@ export HOME="${STATE_DIR%/.openclaw}"
6363

6464
# ── Run custom init script (if provided) ─────────────────────────────────────
6565
INIT_SCRIPT="${OPENCLAW_DOCKER_INIT_SCRIPT:-}"
66-
if [ -n "$INIT_SCRIPT" ] && [ -f "$INIT_SCRIPT" ] && [ -x "$INIT_SCRIPT" ]; then
67-
echo "[entrypoint] running init script: $INIT_SCRIPT"
68-
"$INIT_SCRIPT" || echo "[entrypoint] WARNING: init script exited with code $?"
66+
if [ -n "$INIT_SCRIPT" ]; then
67+
if [ ! -f "$INIT_SCRIPT" ]; then
68+
echo "[entrypoint] WARNING: init script not found: $INIT_SCRIPT"
69+
else
70+
# Auto-make executable — volume mounts often lose +x
71+
chmod +x "$INIT_SCRIPT" 2>/dev/null || true
72+
echo "[entrypoint] running init script: $INIT_SCRIPT"
73+
"$INIT_SCRIPT" || echo "[entrypoint] WARNING: init script exited with code $?"
74+
fi
6975
fi
7076

7177
# ── Configure openclaw from env vars ─────────────────────────────────────────

0 commit comments

Comments
 (0)