Files
OpenFlare/scripts/agent-entrypoint.sh
T
ryan 9d56f02e64 chore(agent): move docker entrypoint script to scripts/
Relocate agent-entrypoint.sh from docker/ to scripts/ so operational
shell scripts live in one directory and update Dockerfile.agent copy path.
2026-06-21 14:26:25 +08:00

21 lines
472 B
Bash
Executable File

#!/bin/sh
set -eu
RUNTIME_USER="openflare"
AGENT_BIN="/usr/local/bin/openflare-agent"
fix_runtime_ownership() {
for target in /data /etc/openflare; do
if [ -d "$target" ]; then
chown -R "${RUNTIME_USER}:${RUNTIME_USER}" "$target" 2>/dev/null || true
chmod -R u+rwX,g+rX "$target" 2>/dev/null || true
fi
done
}
if [ "$(id -u)" -eq 0 ]; then
fix_runtime_ownership
exec su-exec "${RUNTIME_USER}" "${AGENT_BIN}" "$@"
fi
exec "${AGENT_BIN}" "$@"