#!/bin/bash

NBD=false
LOG=false
#while [ $NBD = false ] || [ $LOG == false ] ; do
while [ $NBD = false ] ; do
  if [ ! -b /dev/nbd0p1 ]; then
    echo "nbd0p1 not there"
  else [ $NBD = false ]
    echo "nbd0p1 there"
    date
    NBD=true
  fi
  if [ ! -d /sd/logs/testlogs ]; then
    echo "testlogs not there"
  else [ $LOG = false ]
    echo "testlogs there"
    date
    LOG=true
  fi
  sleep 2
done
if [ $NBD = true ]; then
#  mount /dev/nbd0p1 /home/ses/barbo/logs
fi
export ROVER_HOME=/home/ses/barbo
cd $ROVER_HOME/control
./executive.rb -r >> /home/ses/barbo/logs/auto_ses.log
