#!/bin/bash declare -r ARGV0='vc-thm' pull_url () { local i=0 echo -n "$ARGV0: " >&2 while true do sleep 0.5 & # limit rate to one per 500 ms curl -sSL "$1" > /dev/null wait let 'i += 1' echo -n "$i " >&2 done } if [ -z "$1" ]; then echo "Usage: $ARGV0 [TIMEOUT]" >& 2 exit 2 fi # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule # > The shortest interval you can run scheduled workflows is once every 5 minutes. [ -z "$2" ] && TIMEOUT=270 || TIMEOUT="$2" set -e pull_url "$1" & CHILD="$!" sleep "$TIMEOUT" set +e kill -TERM "$CHILD" wait echo >&2 exit 0 # don't care about the exit code from pull_url