#!/bin/sh

if test -f /dev/shm/shtdwn.lock
then
  sleep 1
  exit 0
fi

PTH='YOUR_PATH'

ec=0
while test $ec -eq 0
do
    pr=0
    while test $pr -eq 0
    do
	ans=`service ppds status`
	pr=`echo $ans | grep "ppds is running" | wc -l`
	sleep 1
    done
    sleep 6
    PYTHONPATH=$PTH/cpphlib
    export PYTHONPATH
    $PTH/mbrc/mbprc.py
    ec=$?
    sleep 5
done
if test $ec -eq 16
then
  touch /dev/shm/shtdwn.lock
fi
