-
Notifications
You must be signed in to change notification settings - Fork 1
/
irclogger-run.sample
executable file
·26 lines (24 loc) · 1.01 KB
/
irclogger-run.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# host[:port]
host=localhost
# use the same as in your irclogger.conf file in BIN cgi-bin dir
# errors of this bot will go in $logsdir/irclogger.log
logsdir="_LOGS_"
# URL where to go to see web logs
url="_URL_"
# initial channels to log. can be empty. Be cautious in putting more than one,
# or you could be kicked on connecting for flooding!
# if a file $logsdir/CHANNELS.last exists, its contents wil override this var
channels="_CHAN_"
# Uncomment this if the IRC server has a password (and put the relevant passwd)
# export IRC_SERVER_PASSWORD = serverpasswd
while true; do
if test -e "$logsdir/CHANNELS.last"; then
channels=`cat "$logsdir/CHANNELS.last"`
fi
echo "Starting at `date`, logging channels $channels" >>"$logsdir/irclogger.log"
/usr/local/irclogger/irclogger $host '[LOGGER]' \
"$logsdir" "$url" $channels>>"$logsdir/irclogger.log" 2>&1 </dev/null
echo "Stopping at `date`" >>"$logsdir/irclogger.log"
sleep 45 # avoid being kicked for too fast reconnection. should be > 40s
done