Skip to content

Commit c36b710

Browse files
committed
feat(newsboat): add util script for reloading all lists at once
1 parent f44ef1f commit c36b710

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/cron/reload-newsboat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#! /bin/sh
2+
3+
if [ "$1" = "--help" ] || [ "$1" = "-h" ] || [ "$1" = "help" ]; then
4+
cat <<EOF
5+
$ reload-newsboat
6+
Reload all newsboat instances
7+
EOF
8+
exit
9+
fi
10+
11+
command -v newsboat >/dev/null || { echo "newsboat is not installed" 1>&2; exit 127; }
12+
13+
find ~/.config/newsboat -name "urls-*" | while read -r urlFile; do
14+
id=$(echo $urlFile | rev | cut -d- -f1 | rev)
15+
newsboat -u $urlFile -c ~/.config/newsboat/cache-$id.db --quiet -x reload &
16+
done

0 commit comments

Comments
 (0)