### ### mkindexr.sh ### ### Recurse through subdirectories, finding HTML ### Create index.html page from results ### ### ### ### ### Hard coded. Bad. Need to genericize. ### DIR=/usr/tomcat/webapps/ROOT/setgetweb/Agiliti cd $DIR echo "<html> " > index.html echo "<head> " >> index.html echo " <title> Agiliti 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> Agiliti Index </h1> " >> index.html echo "<p>&nbsp;</p>" >> index.html echo "<FORM METHOD=get ACTION=\"/cgi-bin/search_agiliti.cgi\">" >> index.html echo " <INPUT TYPE=\"text\" NAME=\"terms\">" >> index.html echo " <INPUT TYPE=\"submit\" value=\"Search Agiliti\">" >> 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 "<h3>Overview</h3>" >> index.html echo "<p>This is a listing of logs at Agiliti. To update, run..." >> index.html echo "<p><blockquote>" >> index.html echo " /usr/local/bin/getlogs.agiliti.sh" >> index.html echo "</blockquote>" >> index.html echo "<p> ...as user <b>log</b>. You will be prompted to enter the password for the log account on the Management server twice. Then everything should be golden...." >> index.html echo "<p>To refresh this index.html file, run: idxagiliti.sh " >> index.html echo " " >> index.html echo "<p><hr> " >> index.html echo "<h3>Logs</h3>" >> index.html a="xyz" for i in `find . -name \*.html -print | grep -v \.\/index.html | grep -v html.html | grep -v \.gif` 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://intranet\"><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