verifier.sh: Add email notification

The script uses mutt to send and email. On my workstation it is configured to
use gmail.
pull/14/head
Jesus Alvarez 12 years ago
parent 90339b15da
commit 38bd053244
  1. 18
      verifier.sh

@ -9,6 +9,8 @@
REPO_BASEPATH="/data/pacman/repo" REPO_BASEPATH="/data/pacman/repo"
REMOTE_LOGIN="jalvarez@jalvarez.webfactional.com" REMOTE_LOGIN="jalvarez@jalvarez.webfactional.com"
EMAIL="jeezusjr@gmail.com"
source "lib.sh" source "lib.sh"
compute_local_repo_hash() { compute_local_repo_hash() {
@ -39,17 +41,23 @@ compute_remote_repo_hash() {
compare_repo() { compare_repo() {
# $1: The repo name to compare # $1: The repo name to compare
compute_local_repo_hash $1 if [[ $(compute_local_repo_hash $1) != $(compute_remote_repo_hash $1) ]]; then
echo $LOCAL_REPO_HASH return 1
compute_remote_repo_hash $1 fi
echo $REMOTE_REPO_HASH
} }
# #
# Check demz-repo-archiso # Check demz-repo-archiso
# #
compare_repo "demz-repo-archiso" "x86_64" if [[ $(compare_repo "demz-repo-archiso") != 0 ]]; then
msg "The database is out of sync, sending notification..."
send_email "demz-repo-archiso is out of sync!" "demz-repo-archiso is not in sync!"
fi
# #
# Check demz-repo-core # Check demz-repo-core
# #
if [[ $(compare_repo "demz-repo-core") != 0 ]]; then
msg "The database is out of sync, sending notification..."
send_email "demz-repo-core is out of sync!" "demz-repo-core is not in sync!"
fi

Loading…
Cancel
Save