inbox-reddit: fix unread when it is not always an integer (#44)
This commit is contained in:
parent
b68807a2ae
commit
c39acf19c6
@ -3,6 +3,11 @@
|
|||||||
url="your url here"
|
url="your url here"
|
||||||
unread=$(curl -sf "$url" | jq '.["data"]["children"] | length')
|
unread=$(curl -sf "$url" | jq '.["data"]["children"] | length')
|
||||||
|
|
||||||
|
case "$unread" in
|
||||||
|
''|*[!0-9]*)
|
||||||
|
unread=0
|
||||||
|
esac;
|
||||||
|
|
||||||
if [ "$unread" -gt 0 ]; then
|
if [ "$unread" -gt 0 ]; then
|
||||||
echo "#1 $unread"
|
echo "#1 $unread"
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user