#!/bin/bash perl header.pl echo "
Processing LCD Paper...
" echo "" echo "

\"LCD

" echo "

Processing... (1 of 6)

" echo "

Please be patient. This will take about one minute.

" LANDOMAIN=intra.bostoncoop.net WANDOMAIN=www.bostoncoop.net NOT_ONLINE_ERR=1 SUCCESS_ERR=0 collect() { echo "

Collecting wiki pages (2 of 6)

" x=`tempfile` wget --http-user=crunch --http-passwd=crunch -q -O $x http://$HOST/lcd?Outline if [ -e full.html ] then rm full.html fi if [ -e final.aux ] then rm final.aux fi if [ -e final.log ] then rm final.log fi if [ -e tmpful ] then rm tmpful fi grep " tmpful ; cat tmpful >> full.html /gi" | bash } quit_out() { rm final.aux final.log wiki_working.tmp 2> /dev/null if [ -e tmpful ] then rm tmpful fi if [ -e full.html ] then rm full.html fi echo "

All done!


" echo "
" exit 0 } if ( /sbin/ifconfig | grep 192.168 > /dev/null ) then HOST=$LANDOMAIN collect elif ( /sbin/ifconfig | grep eth0 > /dev/null ) then HOST=$WANDOMAIN collect else echo "

Not online!

" if [ ! -e full.html ] then echo "

No full.html to work on. Exiting.

" quit_out else echo "

Using cached copy of wiki pages.

" fi fi if [ -e wiki_working.tmp ] then echo "Process already in progress by another user." exit 1 else touch wiki_working.tmp fi echo "

Formatting (3 of 6)

" perl wiki2tex > final.tex echo "

Converting to PDF (4 of 6)

" pdfelatex final.tex echo "

Generating Table of Contents (5 of 6)

" pdfelatex final.tex echo "

Converting to RTF (6 of 6)

" latex2rtf final.tex 2> /dev/null quit_out