runbot 392 Bytes
Newer Older
1 2 3
#!/bin/sh

PATH=/bin:/usr/bin
4 5 6 7 8 9 10 11 12 13 14

NOW=`date +%Y-%m-%d_%H%M`
if [ "x$1" = "x" ]; then
    CONFIG=""
else
    CONFIG="--config $1"
fi

LOLBOTS=`ps -ef|grep 'lolbot.py'|grep -v grep|awk '{print $2}'`
if [ "$LOLBOTS" != "" ]; then
    kill $LOLBOTS
15 16
fi

17 18
cd `dirname $0`
APP_PATH=`pwd`
19
while true; do
20
    /usr/bin/python $APP_PATH/lolbot.py $CONFIG > logs/server-$NOW.log 2> logs/error-$NOW.log
21
done
22