first updates.
This commit is contained in:
parent
a1e3cb078f
commit
ae2a737d2c
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
log.txt
|
||||
.bot.cfg
|
@ -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
8
bot.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user