summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe <joe@joelightning.com>2012-03-30 21:12:30 +0100
committerJoe <joe@joelightning.com>2012-03-30 21:12:30 +0100
commit0d981221fd153c822ad36e8a421cca81661c59c8 (patch)
tree0c53c08f0d28bf70d812c240a410f280643bb5be
parent50cee8659c3b578e4b273d4a3977979c2673a839 (diff)
improved the code I just wrote
-rwxr-xr-xchili_change_detector6
1 files changed, 3 insertions, 3 deletions
diff --git a/chili_change_detector b/chili_change_detector
index bf1bfec..a0269db 100755
--- a/chili_change_detector
+++ b/chili_change_detector
@@ -19,10 +19,10 @@ another_fifo="/tmp/pbot-ng_chili_change_detector_fifo"
# other pbot-ng modules but I cba. This code is quite l33t actually because it
# doesn't delay the messages at all unless two messages get delivered in two
# minutes.
-while true
+tail -f "${another_fifo}" | while true
do
- read smile < "${another_fifo}" && echo "${smile}" >> "${bot_ipc}"
- read -t 120 smile < "${another_fifo}" && echo "${smile}" >> "${bot_ipc}" ||
+ read smile && echo "${smile}" >> "${bot_ipc}"
+ read -t 120 smile && echo "${smile}" >> "${bot_ipc}" ||
continue
sleep 2m
done &