Files
CTFCUP-25/grob/docker-entrypoint.sh
2025-12-05 11:14:59 +03:00

15 lines
349 B
Bash
Executable File

#!/bin/sh
set -euo pipefail
# Ensure the ctf user exists (defensive in case the base image changes)
if ! id ctf >/dev/null 2>&1; then
useradd -m -u 1001 ctf
fi
# Ensure the history directory exists and has correct ownership
mkdir -p /app/history
chown -R ctf:ctf /app/history
# Run the grob service as ctf user
exec runuser -u ctf -- /app/grob