This commit is contained in:
root
2026-09-19 20:21:47 +02:00
commit 0798933b05
62 changed files with 7658 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Run one simulated day inside the running container.
#
# scripts/daily.sh [daily flags...]
#
# Schedule it once a day, e.g. in crontab:
# 0 6 * * * /path/to/scripts/daily.sh >> /var/log/halcyon-daily.log 2>&1
#
# Environment:
# HALCYON_CONTAINER container name (default: halcyon, as in docker-compose.yml)
#
# The world settings (WH_SEED, WH_ASTEROIDS, ...) come from the container's
# environment, so the daily run always matches the server.
set -euo pipefail
container="${HALCYON_CONTAINER:-halcyon}"
if ! docker inspect -f '{{.State.Running}}' "$container" 2>/dev/null | grep -qx true; then
echo "error: container '$container' is not running (try: docker compose up -d)" >&2
exit 1
fi
echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) running daily job in $container"
# No -t: this must work from cron, where there is no terminal.
exec docker exec "$container" daily "$@"