#!/bin/bash function intr() { echo Halting exit } trap intr SIGINT SLEEP_INT=$1 [[ -n "$SLEEP_INT" ]] || SLEEP_INT=60 echo Starting builder polling every $SLEEP_INT seconds... # polls a redis queue for jobs, starts the builder when it's got some while true do SNAPSHOT_URI=$(redis-cli -h redis LPOP snapshots) [[ -n "$SNAPSHOT_URI" ]] && ./godot-export.sh "$SNAPSHOT_URI" sleep $SLEEP_INT done