]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use more portable awk
authorMark Andrews <marka@isc.org>
Fri, 19 Sep 2014 05:00:18 +0000 (15:00 +1000)
committerMark Andrews <marka@isc.org>
Fri, 19 Sep 2014 05:00:18 +0000 (15:00 +1000)
bin/tests/system/sfcache/tests.sh

index a712b7ca2c99506c1a209eb23dfeed6c3c59de38..2692585fcc96574467bbd7eef986ebe401f589d1 100644 (file)
@@ -29,7 +29,7 @@ ret=0
 $DIG $DIGOPTS +dnssec foo.example. a @10.53.0.5 > dig.out.ns5.test$n || ret=1
 $RNDC -c ../common/rndc.conf -s 10.53.0.5 -p 9953 dumpdb -all 2>&1 | sed 's/^/I:ns5 /'
 for i in 1 2 3 4 5 6 7 8 9 10; do
-    awk '/Zone/{out=0} out; /SERVFAIL/{out=1}' ns5/named_dump.db > sfcache.$n
+    awk '/Zone/{out=0} { if (out) print } /SERVFAIL/{out=1}' ns5/named_dump.db > sfcache.$n
     [ -s "sfcache.$n" ] && break
     sleep 1
 done
@@ -57,13 +57,13 @@ status=`expr $status + $ret`
 echo "I:disabling server to force non-dnssec SERVFAIL"
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 stop 2>&1 | sed 's/^/I:ns2 /'
 
-awk '/SERVFAIL/ { next; out=1 } /Zone/ { out=0 } out { print }' ns5/named_dump.db
+awk '/SERVFAIL/ { next; out=1 } /Zone/ { out=0 } { if (out) print }' ns5/named_dump.db
 echo "I:checking SERVFAIL is cached ($n)"
 ret=0
 $DIG $DIGOPTS bar.example. a @10.53.0.5 > dig.out.ns5.test$n || ret=1
 $RNDC -c ../common/rndc.conf -s 10.53.0.5 -p 9953 dumpdb -all 2>&1 | sed 's/^/I:ns5 /'
 for i in 1 2 3 4 5 6 7 8 9 10; do
-    awk '/Zone/{out=0} out; /SERVFAIL/{out=1}' ns5/named_dump.db > sfcache.$n
+    awk '/Zone/{out=0} { if (out) print } /SERVFAIL/{out=1}' ns5/named_dump.db > sfcache.$n
     [ -s "sfcache.$n" ] && break
     sleep 1
 done