Changeset 474


Ignore:
Timestamp:
Mar 1, 2005, 8:25:04 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • better script
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/testsuite/makehtml.sh

    r470 r474  
    44echo '<html><body bgcolor="#aaddff"><h1>CAPTCHA samples</h1><table>' >> index.html
    55
    6 find -maxdepth 2 -name '*00.*' | cut -b3- | sed 's,/[^.]*., ,' | sort | uniq | while read DIRNAME EXTENSION; do
    7   echo "${DIRNAME}"
     6find -maxdepth 2 -name '*_000.*' | cut -b3- | sed 's,/[^.]*., ,' | sort | uniq | while read DIRNAME EXTENSION; do
     7  echo -n "${DIRNAME}"
    88  INDEX="${DIRNAME}.html"
    99  rm -f "${INDEX}" && echo > "${INDEX}"
    1010  echo '<html><body bgcolor="#aaddff"><table>' >> "${INDEX}"
    11   N=1
    12   for x in `seq -w 0 99`; do
     11  N=0
     12  for x in `seq -w 0 999`; do
     13    if [ ! -f "${DIRNAME}/${DIRNAME}_$x.${EXTENSION}" ]; then
     14        break
     15    fi
    1316    echo '<tr>' >> "${INDEX}"
    1417    echo '<td><h1><tt>#'"$x"'</tt></h1></td>' >> "${INDEX}"
    15     echo '<td><img src="'"${DIRNAME}/${DIRNAME}$x.${EXTENSION}"'" /></td>' >> "${INDEX}"
     18    echo '<td><img src="'"${DIRNAME}/${DIRNAME}_$x.${EXTENSION}"'" /></td>' >> "${INDEX}"
    1619    TEXT="[untranslated]"
     20    N=$((${N} + 1))
    1721    if [ -r "${DIRNAME}/control.txt" ]; then
    1822        TEXT="`sed -ne ${N}p "${DIRNAME}/control.txt"`"
    19         N=$((${N} + 1))
    2023    fi
    2124    echo '<td><h1><tt>'"$TEXT"'</tt></h1></td>' >> "${INDEX}"
    2225    echo '</tr>' >> "${INDEX}"
    2326  done
     27  echo " - ${N} images"
    2428  echo '</table></body></html>' >> "${INDEX}"
    2529
    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
     30  convert "${DIRNAME}/${DIRNAME}_000.${EXTENSION}" -geometry '150x50>' "${DIRNAME}.jpeg"
     31  echo '<tr><td align="right"><a href="'"${INDEX}"'"><img align="middle" src="'"${DIRNAME}"'.jpeg"></a></td><td><h2>'"${DIRNAME} (${N})"'</h2></td></tr>' >> index.html
    2832done
    2933
Note: See TracChangeset for help on using the changeset viewer.