trans

Unnamed repository; edit this file 'description' to name the repository.
git clone git://fqcor.com/trans.git
Log | Files | Refs | README | LICENSE

bot (400B)


      1 #!/bin/bash
      2 
      3 cd $(dirname "$0")
      4 
      5 source botenv
      6 
      7 while true
      8 do
      9 	rm $input
     10 	mkfifo $input
     11 
     12 	(
     13 		echo "NICK $nick"
     14 		echo "USER $nick * * :$nick"
     15 	) | cat - $input | $connect_command | while read res
     16 	do
     17 		echo "$(date "+[%y:%m:%d %T]")$res" >> $log
     18 		./botreply "$(echo "$res" | tr -d '\r')"
     19 		[[ "$res" =~ "PING" ]] || \
     20 			export previous="$(echo "$res" | tr -d '\r')"
     21 	done > $input
     22 
     23 	sleep 10
     24 done