mirror of https://github.com/archzfs/archzfs
This script will scrape the various webpages tied to the archzfs repository to monitory specific data points and send an email notifcation when they have changed.pull/14/head
parent
d2847b0ddc
commit
7f23afff5a
@ -0,0 +1,17 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
REPO_BASEPATH="/data/pacman/repo" |
||||||
|
REMOTE_LOGIN="jalvarez@jalvarez.webfactional.com" |
||||||
|
|
||||||
|
source "lib.sh" |
||||||
|
|
||||||
|
check_webpage() { |
||||||
|
# $1: The url to scrape |
||||||
|
# $2: The Perl regex to match with |
||||||
|
# $3: Expect match |
||||||
|
# Sends a message on mismatch |
||||||
|
MSTR=$(curl -s "$1" | grep -Po "$2") |
||||||
|
if [[ $MSTR != "$3" ]]; then |
||||||
|
error "Checking \"$1\" expected \"$3\" got \"$MSTR\"" |
||||||
|
fi |
||||||
|
} |
Loading…
Reference in new issue