#!/bin/sh
ISOLX_DIR="isolinux"
INST_DIR="/_config/backup"
cd $INST_DIR

rm -f doc
ln -s /usr/local/share/doc/vdr/ doc

tar -cvjf /mnt/hda5/g2v_boot.tar.bz2 $ISOLX_DIR
tar -cvjf /mnt/hda5/g2v_inst.tar.bz2 -h make_g2v.sh g2v_filedesc setup.sh autorun doc

cd /mnt/hda5
rm -rf /mnt/hda5/g2v_inst
mkdir /mnt/hda5/g2v_inst
mkdir -p /mnt/hda5/g2v_inst/_config/install
mkdir -p /mnt/hda5/g2v_inst/etc/vdr/plugins/admin
cp -rf /_config/install /mnt/hda5/g2v_inst/_config/
cp -rf /etc/conf.d /mnt/hda5/g2v_inst/etc/
cp /etc/vdr/* /mnt/hda5/g2v_inst/etc/vdr/
cp /etc/vdr/plugins/* /mnt/hda5/g2v_inst/etc/vdr/plugins/
cp /etc/vdr/plugins/admin /mnt/hda5/g2v_inst/etc/vdr/plugins/
tar -xzvf g2v_inst.tar.bz2 ./g2v_inst

rm /mnt/hda5/g2v_md5_*
rm /mnt/hda5/g2v_fls_*

DTY=$(date +%y%m%d)
echo "Calculating md5sum ..."
md5sum g2v*.tar.bz2 > /mnt/hda5/g2v_md5_$DTY

DT=$(date +%y%m%d)
$(touch -t ${DT}1200 /mnt/hda5/g2v*)
ls -l /mnt/hda5/g2v_*  | cut -b 24- > /mnt/hda5/g2v_fls_$DTY

	
echo "mkimg end"
echo ""
