1#!/bin/sh
2#
3# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4#
5# This Source Code Form is subject to the terms of the Mozilla Public
6# License, v. 2.0. If a copy of the MPL was not distributed with this
7# file, you can obtain one at https://mozilla.org/MPL/2.0/.
8#
9# See the COPYRIGHT file distributed with this work for additional
10# information regarding copyright ownership.
11
12set -e
13
14# shellcheck source=conf.sh
15. ../conf.sh
16
17cp -f ns2/example1.db ns2/example.db
18
19copy_setports ns1/named.conf.in ns1/named.conf
20copy_setports ns2/named1.conf.in ns2/named.conf
21copy_setports ns3/named1.conf.in ns3/named.conf
22copy_setports ns5/named.conf.in ns5/named.conf
23
24#
25# We remove k1 and k2 as KEYGEN is deterministic when given the
26# same source of "random" data and we want different keys for
27# internal and external instances of inline.
28#
29$KEYGEN -K ns2/internal -a rsasha256 -q inline > /dev/null 2>&1
30$KEYGEN -K ns2/internal -a rsasha256 -qfk inline > /dev/null 2>&1
31k1=$($KEYGEN -K ns2/external -a rsasha256 -q inline 2> /dev/null)
32k2=$($KEYGEN -K ns2/external -a rsasha256 -qfk inline 2> /dev/null)
33$KEYGEN -K ns2/external -a rsasha256 -q inline > /dev/null 2>&1
34$KEYGEN -K ns2/external -a rsasha256 -qfk inline > /dev/null 2>&1
35test -n "$k1" && rm -f ns2/external/"$k1".*
36test -n "$k2" && rm -f ns2/external/"$k2".*
37