From 1f1520bac4ce17523053e9fd825805473ab7aafb Mon Sep 17 00:00:00 2001 From: ircnet Date: Tue, 8 Sep 2009 09:32:35 +0000 Subject: [PATCH] Added SVN commit and HUP to the cron, only if there are no errors reported. git-svn-id: svn+ssh://svn.ipng.nl/usr/share/subversion/repositories/ircnet.ipng.ch@36 c5d60b8d-fdcb-4146-b734-af4215e9eb71 --- cron/ilines_update.cron | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/cron/ilines_update.cron b/cron/ilines_update.cron index 6afda9e..40ddc4f 100644 --- a/cron/ilines_update.cron +++ b/cron/ilines_update.cron @@ -53,11 +53,11 @@ do_asset() function bitcron_main() { - cd /home/ircd/ircd/etc || fatal "No config directory" + cd $OUTPUT_ROOT || fatal "No OUTPUT_ROOT directory" echo "Gathering I-Lines for countries" - do_country ch 200 1000 - do_country li 202 15 + do_country ch 200 1200 || error "ilines.ch.conf failed" + do_country li 202 10 || error "ilines.li.conf failed" echo "Gathering I-Lines for AS numbers" ASN_LIST=$(awk -F'|' '$2=/(CH|LI)/ { @@ -67,12 +67,22 @@ function bitcron_main() printf $4 } }' < $INPUT_DELEGATED ) - do_asn $ASN_LIST 250 1000 + do_asn $ASN_LIST 250 1300 || error "ilines.asn.conf failed" echo "Gathering I-Lines for AS-SETs" - do_asset AS-IP-MAN-PEERING-TIX,AS-IP-MAN-PEERING-CIXP,AS-IP-MAN-PEERING-SWISSIX 300 1000 + do_asset AS-IP-MAN-PEERING-TIX,AS-IP-MAN-PEERING-CIXP,AS-IP-MAN-PEERING-SWISSIX 300 1300 || error "ilines.as-set.conf failed" - # svn commit -m "Automatic I-lines update by ilines_update.cron" - # pkill -HUP ircd + if [ $ERR -eq 0 ]l; then + echo "This is what we've got:" + ls -l $OUTPUT_ROOT/include/ilines.*.conf + tail -n 1 $OUTPUT_ROOT/include/ilines.*.conf + echo "Committing to SVN" + svn commit -m "Automatic I-lines update by ilines_update.cron" + + echo "HUPing ircd" + pkill -HUP ircd + else + fatal "Not submitting/HUPing. This needs human attention" + fi }