aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2005-11-22 22:24:27 +0000
committerDoug Barton <dougb@FreeBSD.org>2005-11-22 22:24:27 +0000
commita2362f35f6814fb6172a61341510b9f4e5e7b604 (patch)
treef9ef2e38b9603668f071153efd7a6922ce24af94 /etc
parentdcb740a42a33210b1a54a38221103281681553f6 (diff)
downloadsrc-a2362f35f6814fb6172a61341510b9f4e5e7b604.tar.gz
src-a2362f35f6814fb6172a61341510b9f4e5e7b604.zip
Update the test for failed zone transfers to reflect BIND 9.3.1 semantics
Simplify the shell scripting a bit, and remove a useless grep | sed The problem was pointed out by the PR, and I used part of the solution suggested there, but the semantics changed again for 9.2.x -> 9.3.x. PR: conf/74228 Submitted by: Jeremy Chadwick <freebsd@jdc.parodius.com>
Notes
Notes: svn path=/head/; revision=152697
Diffstat (limited to 'etc')
-rwxr-xr-xetc/periodic/daily/470.status-named18
1 files changed, 8 insertions, 10 deletions
diff --git a/etc/periodic/daily/470.status-named b/etc/periodic/daily/470.status-named
index 5607bfb97bfc..d78f4658b414 100755
--- a/etc/periodic/daily/470.status-named
+++ b/etc/periodic/daily/470.status-named
@@ -31,24 +31,22 @@ case "$daily_status_named_enable" in
start=`date -v-1d '+%b %e'`
rc=$(catmsgs |
- fgrep '^'"$start"'.*named\[[[:digit:]]\+\]: denied [AI]XFR from \[.*\]\.[[:digit:]]\+ for' | \
- sed -e 's/.*: denied [AI]XFR from \[\(.*\)\]\.[[:digit:]]* for "\(.*\)".*$/\2 from \1/'
+ fgrep -E ".*named\[[[:digit:]]+\]: transfer of .*failed .*: REFUSED" |
+ sed -e "s/.*transfer of \'\(.*\)\/IN\' from \(.*\)#[0-9]*: .*/\1 from \2/" |
sort -f | uniq -ic | (
usedns=0
- if [ X"${daily_status_named_usedns}" != X"" ]; then
- case $daily_status_named_usedns in
- [yY][eE][sS]) usedns=1 ;;
- esac
- fi
+ case "$daily_status_named_usedns" in
+ '') ;;
+ [yY][eE][sS]) usedns=1 ;;
+ esac
while read line ;do
ipaddr=`echo "$line" | sed -e 's/^.*from //'`
if [ $usedns -eq 1 ]; then
name=`host "${ipaddr}" 2>/dev/null | \
- grep 'domain name pointer' | \
- sed -e 's/^.* //'`
+ sed 's/.*domain name pointer \(.*\)\./\1/'`
fi
- if [ X"${name}" != X"" ]; then
+ if [ -n "${name}" ]; then
echo "${line} (${name})"
else
echo "${line}"