Some more fixing in the make(1) files
[iii.git] / query.sh
blobe33bb03040f7b26992d0165ba5a52b99c6379500
1 #!/bin/sh
2 # ----------------------------------------------------
3 # Nico Golde <nico@ngolde.de>
4 # License: do whatever you want with this code
5 # Purpose: locate new queries for the ii irc client
6 # ----------------------------------------------------
8 IRCPATH=$HOME/irc
9 TMPFILE=$IRCPATH/queries.tmp
11 if [ ! -f $TMPFILE ]; then
12 touch $TMPFILE
15 echo "searching new query data"
16 for i in `find $IRCPATH -newer $TMPFILE -name 'out'`
18 grep -v '\-!\-' $i > /dev/null 2>&1 # if file doesnt just contain server stuff
19 if [ $? -ne 1 ]; then
20 # strip server, nickserv and channel out files
21 echo $i | egrep -v -i "nickserv|#|$IRCPATH/(irc\.freenode\.net|irc\.oftc\.net)/out" > /dev/null 2>&1
22 if [ $? -ne 1 ]; then
23 echo -e "new data in: $i\n========================================================"
24 tail -5 $i
27 done
29 touch $TMPFILE