first updates.

This commit is contained in:
Storm Dragon 2016-09-02 10:58:05 -04:00
parent a1e3cb078f
commit ae2a737d2c
3 changed files with 17 additions and 7 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
log.txt
.bot.cfg

View File

@ -1,5 +1,11 @@
server="irc.freenode.net"
channel="linux"
nick="bashbot"
user="username hostname servername :realname"
server="irc.netwirc.tk"
port=6667
#enter channels here in quotes before the )
channel=(
"a11y"
)
nick="storm_bot"
# format=username hostname servername :realname
user="$nick ${server%.} $server :$nick"
# Path to log file
log="log.txt"

8
bot.sh
View File

@ -1,13 +1,15 @@
#!/bin/bash
. bot.properties
[ -f bot.properties ] && source bot.properties
input=".bot.cfg"
echo "Starting session: $(date "+[%y:%m:%d %T]")">$log
echo "NICK $nick" > $input
echo "USER $user" >> $input
echo "JOIN #$channel" >> $input
for c in ${channel[@]} ; do
echo "JOIN #$c" | tee -a $input
done
tail -f $input | telnet $server 6667 | while read res
tail -f $input | telnet $server $port | while read res
do
# log the session
echo "$(date "+[%y:%m:%d %T]")$res" >> $log