From c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 31 May 2018 17:51:28 +0200 Subject: rss_staggered progress output --- odin/strm/rss_staggered | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/odin/strm/rss_staggered b/odin/strm/rss_staggered index 54bbd1a3..c5198a25 100644 --- a/odin/strm/rss_staggered +++ b/odin/strm/rss_staggered @@ -7,8 +7,13 @@ staggerFile=~/.rss-stagger [[ "${FLOCKER}" != "$0" ]] && exec env FLOCKER="$0" flock -x "${staggerFile}" "$0" "$@" || : -feeds=$(@rss2email@/bin/r2e list | awk -F ':' 'END { print $1; }') -max=$(($feeds + 1)) +typeset -A feeds +r2e list | while read num junk name junk; do + num=${num%:} + feeds[${num}]=${name} +done + +max=$(($#feeds)) num=$(((max * delta_t) / interval)) [[ $num -lt 1 ]] && num=1 @@ -17,6 +22,7 @@ now=$((now % max)) typeset -a run run=() + typeset -a names names=() @@ -25,8 +31,11 @@ n=0 for i in $(seq $((now + 1)) $((now + num + 1))); do n=$((i % max)) run+=$n + names+=$feeds[${n}] done echo $n >! ${staggerFile} +print ${names} + exec @rss2email@/bin/r2e run $run -- cgit v1.2.3