commit 7db23baebff312566c16f3c3594d010739bea82e parent fb5591aad67962446929b727226fd0f91b746e01 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Wed, 15 Apr 2020 11:27:43 +0200 New script for adding feeds to sfeedrc Diffstat:
A | .local/bin/addfeed | | | 14 | ++++++++++++++ |
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/.local/bin/addfeed b/.local/bin/addfeed @@ -0,0 +1,14 @@ +#!/bin/sh +sfeedrc=/var/sfeed/sfeedrc + +if [ $# -lt 2 ]; then + printf 'usage: %s feedname url\n' "${0##*/}" +fi +# use temp file because no write permission in sfeedrc dir +temp="$(mktemp)" +new="$(printf " feed '%s' '%s'\n" "$1" "$2")" +sed "/}/i \\ +$new +" "$sfeedrc" > "$temp" +cat "$temp" > "$sfeedrc" +rm -f "$temp"