Admin/linktest
author wenzelm
Wed May 12 13:54:49 2010 +0200 (2010-05-12)
changeset 36859 51af1657263b
parent 17750 a0745bc36660
permissions -rwxr-xr-x
removed obsolete CVS Ids;
     1 #!/usr/bin/env bash
     2 #
     3 # leightweight link checker for the isabelle website
     4 
     5 
     6 PRG=`basename "$0"`
     7 
     8 usage()
     9 {
    10   echo
    11   echo "Usage: $PRG URL"
    12   echo
    13   exit 1
    14 }
    15 
    16 fail()
    17 {
    18   echo "$1" >&2
    19   exit 2
    20 }
    21 
    22 url="$1"
    23 if [ -z "$url" ]
    24 then
    25   usage;
    26 fi
    27 
    28 type -p ggrep > /dev/zero && GREP=ggrep || GREP=grep
    29 
    30 mkdir -p /tmp/isa_linktest
    31 dir=$(pwd)
    32 cd /tmp/isa_linktest
    33 exec wget --non-verbose --cookies=off --recursive --reject='GraphBrowser.class' --convert-links --page-requisites \
    34    --delete-after \
    35   "$url" \
    36   2>&1 | tee /tmp/isa_linktest.report | "$GREP" -i -B1 "ERROR"
    37 cd "$dir"
    38 rm -rf /tmp/isa_linktest