this is my patched version of ii - the suckless irc client.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
904 B

9 months ago
  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. # ----------------------------------------------------
  7. IRCPATH=$HOME/irc
  8. TMPFILE=$IRCPATH/queries.tmp
  9. if [ ! -f $TMPFILE ]; then
  10. touch $TMPFILE
  11. fi
  12. echo "searching new query data"
  13. for i in `find $IRCPATH -newer $TMPFILE -name 'out'`
  14. do
  15. grep -v '\-!\-' $i > /dev/null 2>&1 # if file doesnt just contain server stuff
  16. if [ $? -ne 1 ]; then
  17. # strip server, nickserv and channel out files
  18. echo $i | egrep -v -i "nickserv|#|$IRCPATH/(irc\.freenode\.net|irc\.oftc\.net)/out" > /dev/null 2>&1
  19. if [ $? -ne 1 ]; then
  20. printf "new data in: %s\n========================================================\n" "$i"
  21. tail -5 $i
  22. fi
  23. fi
  24. done
  25. touch $TMPFILE