diff options
author | Stefan Kaltenbrunner | 2009-02-04 20:58:41 +0000 |
---|---|---|
committer | Stefan Kaltenbrunner | 2009-02-04 20:58:41 +0000 |
commit | 2a51b412181494193a5adccebc44476f3eddad85 (patch) | |
tree | 8e7ce91ab0dd0903ddf86d9fabb1057a24293171 | |
parent | c4e778e04a1cdfbe361578bb53f69bb38928977e (diff) |
make this actually reflect what we have running on nagios.postgresql.org
and switch to using sudo for the rndc call
git-svn-id: https://pgweb.postgresql.org/svn/trunk@2404 8f5c7a92-453e-0410-a47f-ad33c8a6b003
-rw-r--r-- | automirror.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/automirror.sh b/automirror.sh index e9097d6..cec3755 100644 --- a/automirror.sh +++ b/automirror.sh @@ -2,7 +2,7 @@ # Run the automirror script with a timeout (in seconds) TIMEOUT=120 -MAILREPORT="Sysadmin Reports <sysadmin-reports@postgresql.org>" +MAILREPORT="sysadmin-reports@postgresql.org" cd /usr/local/automirror/automirror @@ -12,10 +12,13 @@ export BG=$! export BG2=$! wait ${BG} >/dev/null 2>&1 if [ ! $? = 0 ]; then - echo "An error occured when running the automirror script! Something is wrong!!!" | /usr/sbin/sendmail $MAILREPORT + echo "An error occured when running the automirror script! Something is wrong!!!" | /bin/mail -s "automirror error report" $MAILREPORT exit fi kill ${BG2} >/dev/null 2>&1 -/usr/sbin/rndc reload mirrors.postgresql.org - +sudo /usr/sbin/rndc reload mirrors.postgresql.org +if [ ! $? = 0 ]; then + echo "failed to reload mirrors.postgresql.org zone" | /bin/mail -s "automirror failure report" $MAILREPORT + exit +fi |