taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 61551ea8d1e13ad791b996f5befff984cc5fe219
parent 2e50997b7daabca09f96cb088c3e23bc63d51f33
Author: buckE <buckE@disroot.org>
Date:   Sun, 14 Jun 2020 08:36:07 +0000

linkchecker.sh skeleton script first commit

Diffstat:
Abuildbot/linkchecker.sh | 37+++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+), 0 deletions(-)

diff --git a/buildbot/linkchecker.sh b/buildbot/linkchecker.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Removed because wget is being a bitch: +#set -e + +## This script will scan www.taler.net for broken links and e-mail a copy of the log if any are found. + +logfile="linkchecker.log" + +# Remove old log + +if [ -f "$logfile" ] +then +echo $logfile " exists. Moving to" $logfile".old." +mv $logfile $logfile.old +else + echo "Info: existing log file '$logfile' not found." +fi + +# Use wget to scan www.taler.net and save output + +echo +echo "Running this command:" +echo " wget --spider -r -nd -nv -H -l 1 -w 2 -o $logfile https://www.taler.net/" +wget --spider -r -nd -nv -H -l 1 -w 2 -o $logfile https://www.taler.net/ + +echo + +# Search the log for the phrase "broken link" as this is what wget will report +if grep -iRl 'broken link!!' $logfile + then + echo "Found broken links. !! TODO: Send message here" + exit 0 + else + echo "No broken links found. Nothing more to do." + exit 0 +fi