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
31 lines
820 B
Plaintext
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
|
|
}
|