chiark / gitweb /
bsmtp-pull: tell /usr/sbin/sendmail to deliver in the background rather than queueing
[bin.git] / irssi-notify-server
1 #! /bin/sh
2 set -e
3
4 # Based on:
5 #   http://thorstenl.blogspot.com/2007/01/thls-irssi-notification-script.html
6
7 FNOTIFY="$HOME/.irssi/fnotify"
8 TAIL=
9
10 cleanup () {
11         rm -f "$FNOTIFY"
12         if [ "$TAIL" ]; then
13                 kill "$TAIL"
14         fi
15 }
16 trap cleanup EXIT HUP INT QUIT PIPE TERM
17
18 tail -n 10 "$FNOTIFY" 2>/dev/null || true
19 > "$FNOTIFY"
20 tail -f "$FNOTIFY" &
21 TAIL="$!"
22 while :; do
23         echo .
24         sleep 5
25 done