Files
misc/shell_scripts/wiki_link_checking

28 lines
745 B
Plaintext
Raw Permalink Normal View History

2011-07-14 02:01:00 +02:00
#! /usr/bin/env bash
2011-07-17 20:11:47 +02:00
2011-07-12 23:26:49 +02:00
# http://fabien.benetou.fr/Wiki/ToDo#Maintenance
# TODO
2011-07-17 20:11:47 +02:00
# add incremental option to use with batch
2011-07-12 23:26:49 +02:00
# generalize for other URLs
2011-07-17 20:49:47 +02:00
# RSS output to better handle notification with required actions
2011-07-17 20:11:47 +02:00
2011-07-12 23:26:49 +02:00
if [ $# -lt 1 ]
then
echo "Check page per page against dead links for PmWiki"
echo "usage: $0 PmWiki_path"
exit
fi
PATH=$1
NOW_EPOCH=$(date +"%s")
URL=http://fabien.benetou.fr/
2011-07-17 20:11:47 +02:00
# get the last link checked
# if last or none start from link 1
2011-07-12 23:26:49 +02:00
for PAGE in $(ls $1/wiki.d/* | grep -v PmWiki. | grep -v Site | sed "s/.*wiki\.d\///" | tr "." "/")
do
checklink -s $URL/$PAGE > $PATH/pub/checking/$(echo $PAGE|tr "/" ".").check
# using the Perl W3C-checklink
## should fail if not installed and suggest the CPAN command
done;