#!/bin/sh
##############################
# Coloca background nas licoes
##############################

DIR=/proj/cik/faculty/lotufo/local/dipcourse-1.0
WK=${DIR}/html-dip

# Vai para o diretorio das licoes
cd ${WK}

# Obtem todos os capitulos existentes
CAP=`ls | grep 'c[0-9]*[0-9]'`

# Processa todas as secoes de cada capitulo encontrado
for cap in `echo ${CAP} | sed 's/-^//g'`
  do
# obtem as secoes do capitulo ${cap}
    cd ${cap}
    SEC=`ls | grep 's[0-9]*[0-9]'`

    for sec in `echo ${SEC} | sed 's/-^//g'`
      do
	cd ${sec}
	cat front-page.html | sed s/'<BODY'/'<BODY BACKGROUND=..\/..\/..\/localgif\/khoros_background.gif'/g > front-page.html.tmp
	\rm -f front-page.html
	\mv front-page.html.tmp front-page.html
        cd ..
      done
    cd ..
  done
