etc/services - sync with NetBSD-8
[minix.git] / external / bsd / bind / dist / bin / tests / startperf / setup.sh
blob5186341ffbe8418fbecedb3fec8a26f035e54c2a
1 #!/bin/sh
3 # Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
17 # Id: setup.sh,v 1.4 2011/09/02 21:15:35 each Exp
19 usage () {
20 echo "Usage: $0 [-s] <number of zones> [<records per zone>]"
21 echo " -s: use the same zone file all zones"
22 exit 1
25 if [ "$#" -lt 1 -o "$#" -gt 3 ]; then
26 usage
29 single_file=""
30 if [ $1 = "-s" ]; then
31 single_file=yes
32 shift
35 nzones=$1
36 shift
38 nrecords=5
39 [ "$#" -eq 1 ] && nrecords=$1
41 . ../system/conf.sh
43 cat << EOF
44 options {
45 directory "`pwd`";
46 listen-on { localhost; };
47 listen-on-v6 { localhost; };
48 port 5300;
49 allow-query { any; };
50 allow-transfer { localhost; };
51 allow-recursion { none; };
52 recursion no;
55 key rndc_key {
56 secret "1234abcd8765";
57 algorithm hmac-md5;
60 controls {
61 inet 127.0.0.1 port 9953 allow { any; } keys { rndc_key; };
64 logging {
65 channel basic {
66 file "`pwd`/named.log" versions 3 size 100m;
67 severity info;
68 print-time yes;
69 print-severity no;
70 print-category no;
72 category default {
73 basic;
77 EOF
79 $PERL makenames.pl $nzones | while read zonename; do
80 if [ $single_file ]; then
81 echo "zone $zonename { type master; file \"smallzone.db\"; };"
82 else
83 [ -d zones ] || mkdir zones
84 $PERL mkzonefile.pl $zonename $nrecords > zones/$zonename.db
85 echo "zone $zonename { type master; file \"zones/$zonename.db\"; };"
87 done