#!/bin/sh
# a daemon, start and monitor servers
# 2013-09-27 09:28 created by niujiuru

. $(dirname $0)/modules/funcs/functions.sh
export_env

INTERVAL=60
APP_NAME="rtu_linux_modules.out"

while true
do
  if ! is_running "$APP_NAME"
  then
    echo "starting $APP_NAME: ${APPBINS_PATH}/$APP_NAME &"
    rm -rf ${APPRUNS_PATH}/${APP_NAME}.lock
    ${APPBINS_PATH}/$APP_NAME &
  fi
  sleep $INTERVAL
done
