source: pwntcha/testsuite/makehtml.sh @ 470

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