Now uses sqlalchemy for persistent storage and logging.

* Uses sqlalchemy declarative schema for the log and saved URLs.
 * runbot now not using nohup. Will need to be daemonised somehow.
 * Refactored botcommon.py out of existence.
 * Now reads from a config file which can optionally be specified at the
   command line with --config option.
 * Prints usage with --help or if no config file is found.
This commit is contained in:
Jonathan Harker 2010-06-04 04:38:49 +12:00
parent b7da0dae69
commit eb6357a3b8
7 changed files with 258 additions and 94 deletions

20
runbot
View file

@ -1,12 +1,20 @@
#!/bin/sh
PATH=/bin:/usr/bin
SERVERS=`ps -ef|grep 'lolbot.py'|grep -v grep|awk '{print $2}'`
if [ "$SERVERS" != "" ]; then
kill $SERVERS
NOW=`date +%Y-%m-%d_%H%M`
if [ "x$1" = "x" ]; then
CONFIG=""
else
CONFIG="--config $1"
fi
APP_PATH=/home/johnno/projects/lolbot
cd /tmp
nohup /usr/bin/python $APP_PATH/lolbot.py irc.freenode.net "#zomglol" lolbot > $APP_PATH/server.log 2> $APP_PATH/error.log &
LOLBOTS=`ps -ef|grep 'lolbot.py'|grep -v grep|awk '{print $2}'`
if [ "$LOLBOTS" != "" ]; then
kill $LOLBOTS
fi
cd `dirname $0`
APP_PATH=`pwd`
/usr/bin/python $APP_PATH/lolbot.py $CONFIG > server-$NOW.log 2> error-$NOW.log &