#!/bin/bash
#
# Update index.html as "web page".
# Why? Because apache shows only truncated names, e.g.:
#
#  gp43-Feb24_2008-os2b..> 25-Feb-2008 07:43   3.7M  
#  gp43-Mar24_2008-winb..> 24-Mar-2008 14:13   4.6M  
#  gp43-Mar24_2008-winb..> 24-Mar-2008 15:21   1.0M 
#
# Or is there any "apache config" option to make more space
# for file names?

out="index_TryThisNew.html"

echo '<html>
<! AUTOMATICALLY GENERATED BY upate_index_html.sh >
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>Index of gnuplot /development/binaries/</title>
</head>
<body>
<h1>Index of /development/binaries</h1>
<pre>
' >$out

for a in `ls -1 -X README *.tar.gz *.zip` ; do
    b=`ls -lAFh $a | cut -d\  -f6-9`
    if test "$a" == "README" ;
	then img='<IMG SRC="/icons/hand.right.gif" ALT="[   ]">'
	else img='<IMG SRC="/icons/compressed.gif" ALT="[   ]">'
    fi
    echo "$img  $b    <a href=\"$a\">$a</a>" >>$out
done


echo '</pre>
</body>
</html>
' >>$out

