Files
irc.efnet.nl/cron/update.cron
efnet-nl fbefb98962 Added bitcron(1) and a cron to update and HUP the ircd
git-svn-id: svn+ssh://svn.ipng.nl/usr/share/subversion/repositories/irc.efnet.nl@7 0a436592-62d7-4152-98a5-b7e29e440240
2009-09-07 19:07:46 +00:00

29 lines
687 B
Plaintext

NAME="ircd_update"
AUTHOR="Pim van Pelt"
MAILTO="pim@ipng.nl"
ESCALATE_MAILTO="pim@ipng.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 ] && {
echo "Incorporating these diffs from the repository"
cat $DIFF
svn update || error "Could not update local copy"
echo "Sending -HUP to the ircd"
pkill -HUP ircd || error "Could not send HUP to ircd"
}
rm -f -- $DIFF
}