#!/bin/bash

LOGDIR="/ramdisk"

if [ -z "$1" ]; then
	exit 1
fi

case "$1" in
	"before")
		echo "`date`: $@" >> $LOGDIR/rec_before.log
		for command in /etc/vdr/rec_before.d/*; do
			echo "Start $command" >> $LOGDIR/rec_before.log
		        eval $command $@ &
		done
		;;
	"after")
		echo "`date`: $@" >>  $LOGDIR/rec_after.log
		for command in /etc/vdr/rec_after.d/*; do
			echo "Start $command" >> $LOGDIR/rec_after.log
		        eval $command $@ &
		done
		;;
         "edited")
                echo  "Cut.sh  Edited noad $1 Scan $2" >> $LOGDIR/rec_edited.log
                cut.sh $@ &
		;;
esac
