summaryrefslogtreecommitdiffstats
path: root/share/downreport.in
diff options
context:
space:
mode:
Diffstat (limited to 'share/downreport.in')
-rw-r--r--share/downreport.in27
1 files changed, 14 insertions, 13 deletions
diff --git a/share/downreport.in b/share/downreport.in
index a05a524..0033e18 100644
--- a/share/downreport.in
+++ b/share/downreport.in
@@ -1,8 +1,8 @@
#! /bin/sh
##
-## $Id: downreport.in,v 1.9 2004/01/11 03:43:50 heas Exp $
+## $Id: downreport.in,v 1.12 2006/05/28 16:38:53 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -40,19 +40,23 @@ elif [ "$LIST_OF_GROUPS" = "" ] ; then
exit 1
fi
+# mail variables
+set | grep MAILHEADERS= > /dev/null 2>&1
+if [ $? -ne 0 ] ; then
+ MAILHEADERS="Precedence: bulk\n"; export MAILHEADERS
+fi
for GROUP in $LIST_OF_GROUPS; do
(
echo "To: @MAILPLUS@admin-$GROUP"
echo "Subject: Down router report - $GROUP"
- echo "Precedence: bulk"
+ echo "$MAILHEADERS" | awk '{gsub(/\\n/,"\n");print;}'
echo ""
DIR=$BASEDIR/$GROUP
if [ -s $DIR/routers.down ]; then
(
-
- cat << EOM
-
+ cat << EOM
+
The following $GROUP routers are listed as other than up.
Routers listed as "up" in rancid's router.db are polled several
@@ -61,20 +65,17 @@ not polled.
EOM
- cat $DIR/routers.down;
-
+ cat $DIR/routers.down;
)
-
else
(
+ cat << EOM
- cat << EOM
-
- No routers are down/ticketed for router group $GROUP (yay).
+ No routers are down/ticketed for router group $GROUP (yay).
EOM
- )
+ )
fi
) | sendmail -t