#!/bin/sh

APP_NAME=rftd

if dirname "$0" 1>/dev/null 2>/dev/null; then
    SH_DIR="$(cd "$(dirname "$0")";pwd)"
    cd $SH_DIR
fi

. ./${APP_NAME}-inc.sh
init_env

echo "$$" >/${TMP_DIR}/${APP_NAME}-daemon.pid
while [ 1 ]
do

    if [ -z "`os_pidof ${APP_NAME}`" ]; then
       ./${APP_NAME} -d &
    fi

    sleep 5

done

