summaryrefslogtreecommitdiff
path: root/.local/bin/add2rss
blob: cf9ea732d93ce313396231bdb864d12c5c152719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

RSSFILE=~/.config/newsboat/urls

if test -n "$1";
then
	URL=$1
elif test ! -t 0;
then
	URL=$(cat < /dev/stdin)
else
	echo "add2rss: No Input"
	exit
fi

if test -n "$2";
then
	URL="$URL \"$2\""
fi

if test -n "$(grep $URL $RSSFILE)";
then
	echo "add2rss: You already added this feed"
else
	echo "$URL" >> $RSSFILE
	echo "add2rss: Added"
fi