2004-07-19 09:00:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
# this script is intended to be run daily from cron
|
2005-01-11 02:22:43 +00:00
|
|
|
# GNU GPL Copyright (C) 2004-2005 Bastian Kleineidam
|
2004-07-19 09:00:03 +00:00
|
|
|
|
|
|
|
|
# Put here your url(s) you want to check, separated by whitespace.
|
|
|
|
|
# Urls can also be local files, eg "/var/www/index.html".
|
|
|
|
|
URL="http://www.imadoofus.org/"
|
|
|
|
|
|
|
|
|
|
PATH="/bin:/usr/bin"
|
2005-05-02 15:32:48 +00:00
|
|
|
LOGFILE="$HOME/.linkchecker/blacklist"
|
2004-07-19 09:00:03 +00:00
|
|
|
|
2005-05-02 15:32:48 +00:00
|
|
|
linkchecker -Fblacklist $URL
|
2004-07-19 09:00:03 +00:00
|
|
|
# this awk script complains if urls fail for at least two script runs
|
|
|
|
|
[ -r $LOGFILE ] && awk '/^[[:digit:]]+/ {if ($1 > 1) printf "URL %s failed for %d days.", $2, $1; }' $LOGFILE
|