commit 6ec539cb4fb9fceb11425d96fa078dc3ef5554af parent a1e33201da039642c1e4d14f186e36c7b01fa7ce Author: Christoph Lohmann <20h@r-36.net> Date: Sat, 10 Oct 2020 21:21:15 +0200 Add sfeed-run example. Diffstat:
README.md | | | 5 | +++++ |
sfeed-run | | | 20 | ++++++++++++++++++++ |
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md @@ -18,6 +18,11 @@ For encoding subjects you need rputil(1) from rohrpost: cd sfeed_sendmail make install +## Running + +See feed-run for how sfeed_sendmail can be used with sfeed in +a cronjob. + ## Variables The environment variable $SENDMAILCMD defines which command diff --git a/sfeed-run b/sfeed-run @@ -0,0 +1,20 @@ +#!/bin/sh + +sfeedrc="$HOME/.sfeed/sfeedrc" +toaddr="rss@r-36.net" + +sfeed_update "${sfeedrc}" 2>&1 | grep FAIL +eval $(grep ^sfeedpath= "${sfeedrc}") +cd $sfeedpath +find . -type f -not -name '*.new' -not -name "*.old" \ +| while read -r filen; +do + [ ! -f ${filen}.old ] && touch ${filen}.old + cat ${filen} ${filen}.old | sort | uniq -u > ${filen}.new + if [ $(stat -c %s "${filen}.new") -gt 0 ]; + then + cat ${filen}.new | sfeed_sendmail "${toaddr}" + fi + cp $filen $filen.old +done +