Files
irc.efnet.nl/cron/update.cron
pim 2d1f41ae76 Make the ircd update cron also mail to admins@efnet.nl, but only if there
are diffs. We then log a warning which makes us choose ESCALATE_MAILTO rather
than MAILTO. See cron/bitcron for details on how this works.



git-svn-id: svn+ssh://svn.ipng.nl/usr/share/subversion/repositories/irc.efnet.nl@16 0a436592-62d7-4152-98a5-b7e29e440240
2009-09-07 21:03:49 +00:00

31 lines
820 B
Plaintext

NAME="ircd_update"
AUTHOR="Pim van Pelt"
# MAILTO="pim@ipng.nl"
ESCALATE_MAILTO="pim@ipng.nl,admins@efnet.nl"
MASTERLOG="/home/ircd/cronscripts/logs/${NAME}.log"
PATH=/usr/local/bin:/usr/bin:/bin:/home/ircd/bin
function bitcron_main()
{
DIFF="/tmp/${NAME}.diff.$$"
cd ~/ircd/etc || fatal "No config directory"
svn diff -r HEAD > $DIFF || fatal "Could not read the SVN repository"
[ ! -r $DIFF ] && fatal "Cannot read diff file"
[ -s $DIFF ] && {
warning "Incorporating these diffs from the repository"
cat $DIFF
svn update || error "Could not update local copy"
echo "Testing ircd config"
/home/ircd/ircd/bin/ircd -conftest || fatal "Invalid configuration at HEAD!"
echo "Sending -HUP to the ircd"
pkill -HUP ircd || error "Could not send HUP to ircd"
}
rm -f -- $DIFF
}