30 lines
465 B
Bash
30 lines
465 B
Bash
|
#! /bin/sh
|
||
|
|
||
|
. /scripts/common.sh
|
||
|
|
||
|
run_in () {
|
||
|
(
|
||
|
cd $1; shift
|
||
|
"$@"
|
||
|
)
|
||
|
}
|
||
|
|
||
|
while sleep 2; do
|
||
|
for mtype in audio video; do
|
||
|
ls $mtype | while read d; do
|
||
|
encode=/scripts/$mtype.encode.sh
|
||
|
workdir=$mtype/$d
|
||
|
[ -f $workdir/read.finished ] || continue
|
||
|
|
||
|
log "Encoding $workdir"
|
||
|
if ! run_in $workdir $encode; then
|
||
|
log "$encode failed"
|
||
|
else
|
||
|
rm -rf $workdir
|
||
|
fi
|
||
|
done
|
||
|
done
|
||
|
done
|
||
|
|
||
|
# vi: ts=2 sw=2 et ai
|