possibly something like this?
Code:
#!/bin/bash
for ifo_file in /downloaddir/DVD/*/VIDEO_TS/VIDEO_TS.IFO
do
mkisofs $ifo_file && rm $ifo_file ## blah, i dont know the syntax to convert ifo to iso
done
for ifo_file in /downloaddir/*/VIDEO_TS.IFO
do
mkisofs $ifo_file && rm $ifo_file ## blah, dont know syntax for mkisofs
done
mv /downloaddir/DVD/*/VIDEO_TS/*.ISO /downloaddir/
mv /downloaddir/*/*.ISO /downloaddir/
rm -Rf /downloaddir/DVD/*
mv /downloaddir/*.ISO /downloaddir/DVD/
As far as checking for the files being written to.... the only thing i can think of is to check for the process that downloads them... to see if its running....
Then you could put something like this right at the start:
Code:
if [ `ps aux | awk '{print $11}' | grep PROCESS` ]
then exit 0
fi
Substituting PROCESS for whatever process actually downloads....
I would carefully test this bad boy though. :-P My scripting is TERRIBLE.
BTW, a great resource for scripting is :
http://www.tldp.org/LDP/abs/html/
--drew