#!/bin/sh
source /etc/conf.d/vdr.admin.cfg

VAL=`cat $ADMIN_CFG_FILE | grep ":$1:" | cut -f 3 -d ":"`
TYPE=`cat $ADMIN_CFG_FILE | grep ":$1:" | cut -f 4 -d ":"`
if [ "$TYPE" = "L" ] ; then
   ALL_VAL=`cat $ADMIN_CFG_FILE | grep ":$1:" | cut -f 6 -d ":" | grep ","`
   VAL=$(($VAL+1))
   SET_VAL=`echo $ALL_VAL | cut -f $VAL -d ","`
else
   SET_VAL=$VAL
fi

if [ "$2" = "-B" ] ; then
   echo $SET_VAL | sed 's/ //g'
else
   echo $SET_VAL | sed 's/^ //g'
fi
