#!/bin/ash
#
# MEMI "Synth process watchdog"
#

APP=MD850SynthEngine
PIDFILE=/var/run/$APP.pid


while :; do
    sleep 4
    if [ ! -e $PIDFILE ]; then
        memictl start synth_engine
    else   
      PID=$(cat $PIDFILE)
      if [ ! -d /proc/$PID ]; then
        memictl start synth_engine
      fi
    fi
done
