#!/bin/bash # $Id: my-tube.sh 2765 2009-06-30 22:02:07Z hendry $ STATICDIR=/home/hendry/static.natalian.org STATICHOST=static.natalian.org VIDEOHOST=video.natalian.org HTML_FILE=v.inc if test -e last.txt then LAST="-newer last.txt" else rm -vrf 20* fi for i in $(find $STATICDIR $LAST -iname '*.ogg' -o -iname '*.ogv' -type f | sort) do Y=$(date +%Y/%m/%d/ -r $i) if test -d $Y then echo $Y already exists else mkdir -p $Y && cp base.shtml $Y/index.shtml echo Created $Y fi THM=(${i%.*}.[Tt][Hh][Mm]) cat >> $Y/$HTML_FILE << EOF

$(date --rfc-2822 -r $i)

EOF if test -f $STATICDIR/${THM#$STATICDIR} then cat >> $Y/$HTML_FILE << EOF
EOF chmod a+r $Y/$HTML_FILE echo Wrote $Y/$HTML_FILE done if test $i then echo $i > last.txt fi