source: pwntcha/testsuite/makehtml.sh @ 443

Last change on this file since 443 was 429, checked in by Sam Hocevar, 15 years ago
  • drupal captchas
  • makehtml.sh script to build the testsuite web
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1005 bytes
Line 
1#!/bin/sh
2
3rm -f index.html && echo > index.html
4echo '<html><body bgcolor="#aaddff"><h1>CAPTCHA samples</h1><ul>' >> index.html
5
6find -maxdepth 2 -name '*00*' | while read i; do
7  echo "$i"
8  DIRNAME="`echo $i | sed 's,/[^/]*$,,'`"
9  EXTENSION="`echo $i | sed 's/.*00//'`"
10  INDEX="$DIRNAME.html"
11  rm -f "$INDEX" && echo > "$INDEX"
12  echo '<html><body bgcolor="#aaddff"><table>' >> "$INDEX"
13  N=1
14  for x in `seq -w 0 99`; do
15    echo '<tr>' >> "$INDEX"
16    echo '<td><h1><tt>#'"$x"'</tt></h1></td>' >> "$INDEX"
17    echo '<td><img src="'"$DIRNAME/$DIRNAME$x$EXTENSION"'" /></td>' >> "$INDEX"
18    TEXT="[untranslated]"
19    if [ -r "$DIRNAME/control.txt" ]; then
20        TEXT="`sed -ne ${N}p "$DIRNAME/control.txt"`"
21        N=$(($N + 1))
22    fi
23    echo '<td><h1><tt>'"$TEXT"'</tt></h1></td>' >> "$INDEX"
24    echo '</tr>' >> "$INDEX"
25  done
26  echo '</table></body></html>' >> "$INDEX"
27
28  echo '<li><a href="'"$INDEX"'">'"$DIRNAME"'</a></li>' >> index.html
29done
30
31echo '</ul></body></html>' >> index.html
32
Note: See TracBrowser for help on using the repository browser.