You need 5 files to run your team on two machines (start, start1, start2, kill1, and kill2)
The scripts samples can be downloaded.
| start | Explanation |
#! /bin/bash
trap kill_team INT
kill_team()
{
echo "Killing Team"
ssh -l $5 $2 -f $1/kill1
ssh -l $5 $3 -f $1/kill2
exit 0
}
ssh -l $5 $2 -f $1/start1 $4
sleep 3
ssh -l $5 $3 -f $1/start2 $4
wait
|
This is your top level start script. Usually, there should be
no need to change it at all for your team. It will be called by the Soccer
Server with six command line parameters: start <YOUR HOME DIR> <MACHINE1> <MACHINE2> <SERVER MACHINE> <USER NAME> After the match, the script will receive a signal from the Soccer Server and run the kill scripts. If you do not understand what happens here, just copy the script to your home directory. Note: This script is changed from the script of RoboCup2006. If you want to run this script on your local machine, you need to configure your ssh service. |
Below are sample scripts starting a team on 2 machines. Please use absolute
file names and make them group executable.
Please also remember that your
team is started by a different user, so don't use variables like $HOME,
or ~/ in your paths.
| start1 | start2 |
#! /bin/sh
host=$1
goalie=/home/robolog/bin/oli
player=/home/robolog/bin/player
${goalie} --host ${host} --goalie &
sleep 2
${player} --host ${host} &
${player} --host ${host} &
${player} --host ${host} &
${player} --host ${host} &
${player} --host ${host} &
|
#! /bin/sh
host=$1
player=/home/robolog/bin/player
coach=/home/robolog/bin/giovanni
${player} --host ${host} &
${player} --host ${host} &
${player} --host ${host} &
${player} --host ${host} &
${player} --host ${host} &
${coach} --host ${host} &
|
Sample kill scripts (don't use path names here). Please make them group executable and double check that they kill all of your programs
| kill1 | kill2 |
#! /bin/sh
goalie=oli
player=player
killall -KILL ${goalie}
killall -KILL ${player}
|
#! /bin/sh
player=player
coach=giovanni
killall -KILL ${player}
killall -KILL ${coach}
|