We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e40a21 commit 19b1cb2Copy full SHA for 19b1cb2
msg_watch/get_new.sh
@@ -3,9 +3,14 @@ NEW=`curl http://adbg.herokuapp.com/messages 2>/dev/null`
3
if (( $? != 0)); then
4
exit $?
5
fi
6
+[[ -e last.json ]] || FIRST_RUN=1
7
touch new.json
8
mv new.json last.json
-echo $NEW | jq . > new.json
9
+curl http://adbg.herokuapp.com/messages 2>/dev/null | jq . > new.json
10
+if (( FIRST_RUN )); then
11
+ echo "FIRST RUN"
12
+ exit 0
13
+fi
14
diff -q last.json new.json
15
if (( $? != 0 )) ; then
16
echo "New Message"
0 commit comments