chiark / gitweb /
bsmtp-pull: drop -2; avoid connection sharing
[bin.git] / validate-directory
1 #! /bin/bash
2
3 HOST="`hostname`"
4
5 set -e
6 [ "$1" ] && cd $1
7 BASE_URL=`pwd -P | sed 's|/home/\([^/]*\)/public_html/|http://'"$HOST"'/~\1/|'`
8 set +e
9
10 shopt -s nullglob
11 for x in *.html; do
12     echo "$BASE_URL/$x"
13     if head -n 1 "$x" | egrep -q '(xml|XHTML)'; then
14         SP_CHARSET_FIXED=YES SP_ENCODING=XML \
15             SGML_CATALOG_FILES=/usr/share/sgml/declaration/xml.soc \
16             nsgmls -wxml -s "$BASE_URL/$x"
17     else
18         nsgmls -s "$BASE_URL/$x"
19     fi
20 done