#!/bin/bash # Variables SITEURL="/newsite" LAYOUT=_layout SITE=site EXTRA='images scripts files' SERVERS='314.sciuro.org chip.sciuro.org skippy.sciuro.org slappy.sciuro.org irc.sciuro.org lists.laurentiusgroep.nl' # Prereq mkdir -p $SITE # Root pagina's rm -rf $SITE/*.html for i in `ls *.txt`; do FILENAME=`echo $i |cut -d\. -f1` cat $LAYOUT/header.html >> $SITE/$FILENAME.html cat $i >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html done # Server directory mkdir -p $SITE/servers/ rm -rf $SITE/servers/*.html for i in `ls servers/*.txt`; do FILENAME=`echo $i |cut -d\. -f1` cat $LAYOUT/header.html >> $SITE/$FILENAME.html cat $LAYOUT/servers.html >> $SITE/$FILENAME.html cat $i >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html done for i in $SERVERS; do HNAME=`echo $i | cut -d\. -f1` DNAME=`echo $i | cut -d\. -f2,3 --output-delimiter=\.` FILENAME=servers/graph-$HNAME cat $LAYOUT/header.html >> $SITE/$FILENAME.html cat $LAYOUT/servers.html >> $SITE/$FILENAME.html cat servers/graph.txt >> $SITE/$FILENAME.html echo "" >> $SITE/$FILENAME.html echo "
" >> $SITE/$FILENAME.html T=$((T+1)) elif [ $T == '5' ]; then echo " | |
" >> $SITE/$FILENAME.html T=1 else echo " | " >> $SITE/$FILENAME.html
T=$((T+1))
fi
IMAGENAME=`echo $j |cut -d\/ -f3`
if [ ! -f $SITE/photo/$DIRNAME/thumbs/$IMAGENAME ]; then
convert -resize 120 photo/$DIRNAME/$IMAGENAME $SITE/photo/$DIRNAME/thumbs/$IMAGENAME
fi
if [ ! -f $SITE/photo/$DIRNAME/normal/$IMAGENAME ]; then
convert -resize 480 photo/$DIRNAME/$IMAGENAME $SITE/photo/$DIRNAME/normal/$IMAGENAME
fi
NAME=`echo $IMAGENAME |cut -d\. -f1`
echo "" >> $SITE/$FILENAME.html
# Picture page
cat $LAYOUT/header.html >> $SITE/photo/$DIRNAME/$NAME.html
echo $BDATE >> $SITE/photo/$DIRNAME/$NAME.html
echo "" >> $SITE/photo/$DIRNAME/$NAME.html
cat $i >> $SITE/photo/$DIRNAME/$NAME.html
echo "" >> $SITE/photo/$DIRNAME/$NAME.html
echo " |