Archive > BeBot 0.5 support

How to auto start BeBot with Linux

(1/1)

xlDanek:
Hey guys!

I have a linux root server (SUSE) running and i wonder how i can auto start Bebot after a reboot of the server. Could anyone give me a quick tutorial how to configure this?

Thanks a lot for your future answers!

Wolfbiter:
You need to setup a crontab that'll call a check script...


--- Code: (crontab) ---0,15,30,45 * * * * /home/username/name_of_chk_file >/dev/null 2>&1

--- End code ---


--- Code: (name_of_chk_file) ---#!/bin/sh
#Crontabscript written for BeBot

botname="NameOfBot"
pattern="php start.php"
botdir="/home/username/botDir"
command="/usr/bin/screen -dmS bot /usr/bin/php start.php"

if ps x | grep "$pattern" | grep -v grep
then
        echo $botname "is still running."
        exit 0
else
        echo "Starting "$botname
        cd $botdir
        $command
        exit 1
fi

--- End code ---

You just have to edit the paths and possible filenames you run (on a multi-bot system renaming start.php to botname.php would make sense, but then you have to change start.php in the script to botname.php instead.

This is what I use for myself, if you can't get it working I will not help you! Use it at your own risk. There's also other posts about this if you do a search for "crontab".

Temar:
Wolf, your advice contains alot of inorrect stuff (prob old )
the main file is StartBot.php
it supports multi bots useing php StartBot.php botname

anyway this is how i have done it

ok this is the system i use

My script works well with multi bots useing screens

for starter i have a script file in the root directory of the bot folder
/home/Bots/all/ being the folder your bot is in

start_botname

--- Code: ---cd /home/Bots/all/; su -c "php StartBot.php leetboss" Bots

--- End code ---
Where Bots is the user that owns/runs the bots

then in etc/init.d/ i got the file names Botname

--- Code: ---#!/bin/sh

case "$1" in
'start')
screen -dmS botname -s /home/Bots/all/start_botname
;;
'stop')
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0

--- End code ---

and ive done that for each bot i run.

xlDanek:
Thany you very much, Temar!  :)

Navigation

[0] Message Index

Go to full version