diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-05-31 17:51:28 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-05-31 17:51:28 +0200 |
commit | c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6 (patch) | |
tree | 8a0b013fb8ab00d6d0b9222e0e2464fb2a978ea2 /odin/strm | |
parent | bb9360bcbec691d7847611ff0b63f15f7563398f (diff) | |
download | nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.tar nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.tar.gz nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.tar.bz2 nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.tar.xz nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.zip |
rss_staggered progress output
Diffstat (limited to 'odin/strm')
-rw-r--r-- | odin/strm/rss_staggered | 13 |
1 files 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 | |||
7 | 7 | ||
8 | [[ "${FLOCKER}" != "$0" ]] && exec env FLOCKER="$0" flock -x "${staggerFile}" "$0" "$@" || : | 8 | [[ "${FLOCKER}" != "$0" ]] && exec env FLOCKER="$0" flock -x "${staggerFile}" "$0" "$@" || : |
9 | 9 | ||
10 | feeds=$(@rss2email@/bin/r2e list | awk -F ':' 'END { print $1; }') | 10 | typeset -A feeds |
11 | max=$(($feeds + 1)) | 11 | r2e list | while read num junk name junk; do |
12 | num=${num%:} | ||
13 | feeds[${num}]=${name} | ||
14 | done | ||
15 | |||
16 | max=$(($#feeds)) | ||
12 | num=$(((max * delta_t) / interval)) | 17 | num=$(((max * delta_t) / interval)) |
13 | [[ $num -lt 1 ]] && num=1 | 18 | [[ $num -lt 1 ]] && num=1 |
14 | 19 | ||
@@ -17,6 +22,7 @@ now=$((now % max)) | |||
17 | 22 | ||
18 | typeset -a run | 23 | typeset -a run |
19 | run=() | 24 | run=() |
25 | |||
20 | typeset -a names | 26 | typeset -a names |
21 | names=() | 27 | names=() |
22 | 28 | ||
@@ -25,8 +31,11 @@ n=0 | |||
25 | for i in $(seq $((now + 1)) $((now + num + 1))); do | 31 | for i in $(seq $((now + 1)) $((now + num + 1))); do |
26 | n=$((i % max)) | 32 | n=$((i % max)) |
27 | run+=$n | 33 | run+=$n |
34 | names+=$feeds[${n}] | ||
28 | done | 35 | done |
29 | 36 | ||
30 | echo $n >! ${staggerFile} | 37 | echo $n >! ${staggerFile} |
31 | 38 | ||
39 | print ${names} | ||
40 | |||
32 | exec @rss2email@/bin/r2e run $run | 41 | exec @rss2email@/bin/r2e run $run |