added simple linktester for isabelle website
authorhaftmann
Tue Sep 27 16:33:36 2005 +0200 (2005-09-27)
changeset 17673b61966d74ff1
parent 17672 25d8a4586836
child 17674 b1aedbc9125a
added simple linktester for isabelle website
Admin/linktest
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Admin/linktest	Tue Sep 27 16:33:36 2005 +0200
     1.3 @@ -0,0 +1,41 @@
     1.4 +#!/usr/bin/env bash
     1.5 +#
     1.6 +# $Id$
     1.7 +#
     1.8 +# leightweight link checker for the isabelle website
     1.9 +
    1.10 +
    1.11 +PRG=`basename "$0"`
    1.12 +
    1.13 +usage()
    1.14 +{
    1.15 +  echo
    1.16 +  echo "Usage: $PRG URL"
    1.17 +  echo
    1.18 +  exit 1
    1.19 +}
    1.20 +
    1.21 +fail()
    1.22 +{
    1.23 +  echo "$1" >&2
    1.24 +  exit 2
    1.25 +}
    1.26 +
    1.27 +url="$1"
    1.28 +if [ -z "$url" ]
    1.29 +then
    1.30 +  usage;
    1.31 +fi
    1.32 +
    1.33 +type -p ggrep > /dev/zero && GREP=ggrep || GREP=grep
    1.34 +
    1.35 +mkdir -p /tmp/isa_linktest
    1.36 +dir=$(pwd)
    1.37 +cd /tmp/isa_linktest
    1.38 +exec wget --non-verbose --cookies=off --recursive --convert-links --page-requisites \
    1.39 +   --delete-after \
    1.40 +  "$url" \
    1.41 +  2>&1 | "$GREP" -i -B1 "ERROR"
    1.42 +cd "$dir"
    1.43 +rm -rf /tmp/isa_linktest
    1.44 +#   --spider --domains="isabelle.in.tum.de isabelle.informatik.tu-muenchen.de"