#!/bin/bash

flag=/tmp/foxxx
Model=/boot/hDVRModel
param=""

if [ -f $Model ]; then
    AS=`grep AS $Model`
    if [ "X"$AS != "X" ]; then   
        FO=`grep FO $Model`
        if [ "X"$FO != "X" ]; then  
            if [ -f $flag ]; then
                param=""
            else
                param="-d"
            fi
        fi
        if [ ! -f /var/lib/hdvr/.as5 ]; then
            cp /usr/local/lib/python2.5/site-packages/instek/as5/as5.ini /var/lib/hdvr/.as5
        fi
        exec /usr/bin/python /usr/local/lib/python2.5/site-packages/instek/as5/main.py $param >/dev/null 2>&1
    else
        exec /usr/bin/python /usr/local/lib/python2.5/site-packages/instek/as5/components.py >/dev/null 2>&1
    fi
fi    
