aidx.sh

 

###
### depotidx.sh
###
### Create an index.html file with a 
### listing of a files underneath $DIR
###
###
###



### 
### Hard coded.  Bad.  Need to genericize.
### 
DIR=/usr/tomcat/webapps/ROOT/depot
cd $DIR

echo "<html> " > index.html
echo "<head> " >> index.html
echo "   <META content=text/css http-equiv=Content-Style-Type> " >> index.html
echo "   <LINK href=\"http://www.setgetweb.com/black.css\" rel=\"stylesheet\" type=\"text/css\"> " >> index.html
echo "   <title> Depot Index </title> " >> index.html
echo "</head> " >> index.html
echo "<body> " >> index.html
echo " " >> index.html
echo "<font class=grey2> " >> index.html
echo " " >> index.html
echo "<blockquote> " >> index.html
echo "<blockquote> " >> index.html
echo " " >> index.html
echo "<p>&nbsp;</p> " >> index.html
echo "<center> " >> index.html
echo "<h1> Depot Index </h1> " >> index.html
echo "<p>&nbsp;</p>" >> index.html
echo "<FORM METHOD=get ACTION=\"/cgi-bin/search_cbo.cgi\">" >> index.html
echo "   <INPUT TYPE=\"text\" NAME=\"terms\">" >> index.html
echo "   <INPUT TYPE=\"submit\" value=\"Search CBO\">" >> index.html
echo "</FORM>" >> index.html
echo "</center> " >> index.html
echo " " >> index.html
echo " " >> index.html
echo " " >> index.html
echo " " >> index.html
echo "<p>&nbsp;</p>" >> index.html
echo "<p><hr> " >> index.html
echo " " >> index.html
echo "<p>To refresh this repository, run <a href="websync.sh.html">websync.sh</a> " >> index.html
echo " <script javascript=\"JavaScript\"> " >> index.html
echo "     document.write(\"<p>Last refresh: \"+document.lastModified); " >> index.html
echo " </script> " >> index.html
echo " " >> index.html
echo "<p><hr> " >> index.html


a="xyz"
for i in `find dev/cbo-afton/primary -name \*.html -print | grep -v \.\/index.html | grep -v html.html`
do
    x=`dirname $i`
    y=`basename $i`
    z=`basename $i .html`
    q=`echo $x | sed "s/\// /g"`
    echo $z

    if [ "$x" = "$a" ]
    then
         echo "<br><a href=\"$x/$y\">$z</a> " >> index.html
    else
         echo "<p>&nbsp</p> " >> index.html
         echo "<p><b>$q</b> " >> index.html
         echo "<p><a href=\"$x/$y\">$z</a> " >> index.html
         a=$x
    fi

    
done

echo " <p><hr> " >> index.html
echo "  " >> index.html
echo " <p>&nbsp;</p> " >> index.html
echo " <a href=\"http://www.setgetweb.com/index.php\"><img border=0 src=\"http://www.setgetweb.com/home.gif\" align=left alt=\"Home\"></a> " >> index.html
echo " <p>&nbsp;</p> " >> index.html
echo " <p>&nbsp;</p> " >> index.html
echo " <p>&nbsp;</p> " >> index.html
echo " <p>&nbsp;</p> " >> index.html
echo "  " >> index.html
echo " </blockquote> " >> index.html
echo " </blockquote> " >> index.html
echo "  " >> index.html
echo " <center> " >> index.html
echo " <br> Copyright 2002. All Rights Reserved. " >> index.html
echo " <script javascript=\"JavaScript\"> " >> index.html
echo "     document.write(\"<br>Last updated: \"+document.lastModified); " >> index.html
echo " </script> " >> index.html
echo "  " >> index.html
echo "  " >> index.html
echo " </center> " >> index.html
echo "  " >> index.html
echo "    </body> " >> index.html
echo " </html> " >> index.html