#!/bin/bash

GETVAL="sh /usr/local/bin/getadmval.sh"
SETVAL="sh /usr/local/bin/setadmval.sh"
DVD2VDR_CFG="/etc/vdr/plugins/dvd2vdr.conf"
DVD2VDR="/usr/local/bin/dvd2vdr.sh"
LOG_FILE="/var/log/vdr/dvd2vdr.log"

ACTION=`$GETVAL ACTION`
echo "ACTION="$ACTION > $DVD2VDR_CFG

LANGUAGE=`$GETVAL LANGUAGE`
echo "LANGUAGE="$LANGUAGE >> $DVD2VDR_CFG

OSDINFO=`$GETVAL OSDINFO`
echo "OSDINFO="$OSDINFO >> $DVD2VDR_CFG

TITLE=`$GETVAL TITLE`
echo "TITLE="$TITLE >> $DVD2VDR_CFG

TITLENUM=`$GETVAL TITLENUM`
echo "TITLENUM="$TITLENUM >> $DVD2VDR_CFG

ACTION_DEMUX=`$GETVAL ACTION_DEMUX`
echo "ACTION_DEMUX="$ACTION_DEMUX >> $DVD2VDR_CFG

WITHOUT_X=`$GETVAL WITHOUT_X`
echo "WITHOUT_X="$WITHOUT_X >> $DVD2VDR_CFG

A52DEC_GAIN=`$GETVAL A52DEC_GAIN`
echo "A52DEC_GAIN="$A52DEC_GAIN >> $DVD2VDR_CFG

ACTION_ENCODE=`$GETVAL ACTION_ENCODE`
echo "ACTION_ENCODE="$ACTION_ENCODE >> $DVD2VDR_CFG

ACTION_MPLEX=`$GETVAL ACTION_MPLEX`
echo "ACTION_MPLEX="$ACTION_MPLEX >> $DVD2VDR_CFG

ACTION_GENINDEX=`$GETVAL ACTION_GENINDEX`
echo "ACTION_GENINDEX="$ACTION_GENINDEX >> $DVD2VDR_CFG

REMOVE=`$GETVAL REMOVE`
echo "REMOVE="$REMOVE >> $DVD2VDR_CFG

CLEAN=`$GETVAL CLEAN`
echo "CLEAN="$CLEAN >> $DVD2VDR_CFG

VERBOSE=`$GETVAL VERBOSE`
echo "VERBOSE="$VERBOSE >> $DVD2VDR_CFG

sh $DVD2VDR >> $LOG_FILE 2>&1&

exit 0


