xref: /netbsd-src/external/bsd/unbound/dist/testdata/speed_local.tdir/speed_local.pre (revision c38e7cc395b1472a774ff828e46123de44c628e9)
1# #-- speed_local.pre--#
2# source the master var file when it's there
3[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
4# use .tpkg.var.test for in test variable passing
5[ -f .tpkg.var.test ] && source .tpkg.var.test
6
7. ../common.sh
8get_random_port 2
9UNBOUND_PORT=$RND_PORT
10FWD_PORT=$(($RND_PORT + 1))
11echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
12
13# make config file
14sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < speed_local.conf > ub.conf
15# start unbound in the background
16PRE="../.."
17$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
18UNBOUND_PID=$!
19echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
20
21cat .tpkg.var.test
22wait_unbound_up unbound.log
23
24