#!/bin/bash
_DATESTAMP=`date`
html_header() {
echo ""
echo "
"
echo ""
echo "Listing of $*"
echo ""
echo ""
echo ""
echo "Listing of $*
"
}
html_footer() {
echo "${_DATESTAMP}: HTML automatically generated by spider.sh in the isp directory
"
echo "
"
echo "Sourced from: Omni Modo Limited"
echo "Author: Michael O'Sullivan"
echo ""
echo ""
echo ""
echo " "
}
make_link() {
echo "$1"
}
spider() {
html_header $(basename `pwd`) > index.html
for i in `ls -F | grep -v index.html` ; do
make_link $i >> index.html
echo "
" >> index.html
done
html_footer >> index.html
for i in $(ls -F | grep '/$' | awk -F/ '{print $1}'); do
cd $i
spider .
cd ..
done
}
# Main program
spider