diff options
Diffstat (limited to 'bin/control_rancid.in')
-rw-r--r-- | bin/control_rancid.in | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/bin/control_rancid.in b/bin/control_rancid.in index f51a21b..bcfd316 100644 --- a/bin/control_rancid.in +++ b/bin/control_rancid.in @@ -1,6 +1,6 @@ #! /bin/sh ## -## $Id: control_rancid.in,v 1.61 2004/01/11 05:25:13 hank Exp $ +## $Id: control_rancid.in,v 1.64 2004/03/12 23:13:09 heas Exp $ ## ## Copyright (C) 1997-2004 by Terrapin Communications, Inc. ## All rights reserved. @@ -82,8 +82,9 @@ TMP=${TMPDIR:=/tmp}/rancid.$GROUP.$$ trap 'rm -fr $TMP;' 1 2 15 # the receipient(s) of diffs -mailrcpt=${mailrcpt:-"@MAILPLUS@$GROUP"}; export mailrcpt -adminmailrcpt=${mailrcpt:-"@ADMINMAILPLUS@$GROUP"}; export adminmailrcpt +mailrcpt=${mailrcpt:-"@MAILPLUS@${GROUP}${MAILDOMAIN}"}; export mailrcpt +adminmailrcpt=${mailrcpt:-"@ADMINMAILPLUS@${GROUP}${MAILDOMAIN}"}; +export adminmailrcpt # Number of things par should run in parallel. PAR_COUNT=${PAR_COUNT:-5} @@ -127,9 +128,6 @@ then echo "$DIR/router.db does not exist." ) | sendmail -t exit 1; -elif [ ! -s $DIR/router.db ] -then - exit fi # generate the list of all, up, & down routers @@ -140,15 +138,15 @@ sed -e '/^#/d' -e 's/^ *//' -e 's/ *$//' -e 's/ *: */:/g' router.db | sort -u > routers.db cut -d: -f1,2 routers.db > routers.all.new if [ ! -f routers.all ] ; then touch routers.all; fi -diff routers.all routers.all.new > /dev/null 2>&1; RALL=$? +@DIFF_CMD@ routers.all routers.all.new > /dev/null 2>&1; RALL=$? @PERLV@ -F: -ane '{($F[0] =~ tr@A-Z@a-z@,print $_) if ($F[2] !~ /^up$/i);}' routers.db > routers.down.new if [ ! -f routers.down ] ; then touch routers.down; fi -diff routers.down routers.down.new > /dev/null 2>&1; RDOWN=$? +@DIFF_CMD@ routers.down routers.down.new > /dev/null 2>&1; RDOWN=$? @PERLV@ -F: -ane '{($F[0] =~ tr@A-Z@a-z@,print "$F[0]:$F[1]\n") if ($F[2] =~ /^up$/i);}' routers.db > routers.up.new if [ ! -f routers.up ] ; then touch routers.up; fi -diff routers.up routers.up.new > /dev/null 2>&1; RUP=$? +@DIFF_CMD@ routers.up routers.up.new > /dev/null 2>&1; RUP=$? if [ $RALL -ne 0 -o $RDOWN -ne 0 -o $RUP -ne 0 ] then |