pushd `dirname $0` > /dev/null
MY_DIR=`pwd`
popd > /dev/null
source $MY_DIR/_inc_constants.sh

robotId=$1

if [ "${robotId}" == "" ]; then
	for robotId in ${ROBOT_IDS[@]}; do
	    echo ">>> Ending program on robot ${robotId}"
		ssh -n -f root@192.168.20.${robotId} "sh -c 'pkill -SIGINT Controller &'" &
	done
	
else
	echo ">>> Ending program on robot ${robotId}"
	ssh -n -f root@192.168.20.${robotId} "sh -c 'pkill -SIGINT Controller &'" &
	
fi





