#!/bin/sh
# Version: 0.2.0
# Author: Dimitrios Dimitrakos mail@dimitrios.de
# $Id: writedvd.sh,v 1.3 2004/11/10 15:27:01 dimi Exp $


# Read environment
vco_user=`id -n -u`
homedir=`cat /etc/passwd|grep "^${vco_user}:"|cut -f6 -d ':'`
. $homedir/.vdrconvert/vdrconvert.env
cd $VDRCONVERTDIR

DIR=$1

#[ "$DEBUG" = "yes" ] && set -x

if [ ! -z "$SERVER" ]
then
	ssh $SERVER "$0 $1"
else

    Image=`ls -l $DIR/Image.iso|cut -f2 -d '>'|awk '{print $1}'`
    if [ -r ${Image} ]
    then
      if [ "$MINIDVD" = "yes" ]
      then
          # 
          #  FILE:TYPE:POSTACTION
          #
          echo "${Image}:MINIDVD:DEL" >> $VCOQUEUEDIR/burn
      else
          echo "${Image}:DVD:DEL" >> $VCOQUEUEDIR/burn
      fi
    fi
fi

