autobroadcaster/start-scheduler.sh

38 lines
888 B
Bash
Executable File

#!/bin/bash
set -e
echo "Starting Movie Scheduler..."
# Wait for config file from init container
CONFIG_FILE="/config/nocodb_config.env"
echo "Waiting for initialization to complete..."
for i in {1..60}; do
if [ -f "$CONFIG_FILE" ]; then
echo "✓ Configuration found!"
break
fi
if [ $i -eq 60 ]; then
echo "✗ Timeout waiting for configuration"
exit 1
fi
sleep 1
done
# Load configuration
source "$CONFIG_FILE"
# Set environment variables for the scheduler
export NOCODB_URL="http://nocodb:8080/api/v2/tables/${NOCODB_TABLE_ID}/records"
export NOCODB_TOKEN="${NOCODB_TOKEN}"
export RTMP_SERVER="${RTMP_SERVER:-rtmp://rtmp:1935/live/stream}"
echo "Configuration loaded:"
echo " NOCODB_URL: $NOCODB_URL"
echo " RTMP_SERVER: $RTMP_SERVER"
echo ""
echo "Starting scheduler agent..."
# Start the scheduler
exec python -u agent.py