aboutsummaryrefslogtreecommitdiff
path: root/src/dht/dhtu_testbed_deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/dhtu_testbed_deploy.sh')
-rwxr-xr-xsrc/dht/dhtu_testbed_deploy.sh84
1 files changed, 0 insertions, 84 deletions
diff --git a/src/dht/dhtu_testbed_deploy.sh b/src/dht/dhtu_testbed_deploy.sh
deleted file mode 100755
index 908bbf685..000000000
--- a/src/dht/dhtu_testbed_deploy.sh
+++ /dev/null
@@ -1,84 +0,0 @@
1#!/bin/bash
2# This file is in the public domain.
3
4# We will use UDP ports above this number.
5MINPORT=10000
6
7# Cleanup to run whenever we exit
8function cleanup()
9{
10 for n in `jobs -p`
11 do
12 kill $n 2> /dev/null || true
13 done
14 wait
15}
16
17# Install cleanup handler (except for kill -9)
18trap cleanup EXIT
19
20if test -z "$1"
21then
22 echo "Call with the number of peers to launch."
23 exit 1
24fi
25
26if test ! -x `which parallel`
27then
28 echo "This script requires GNU parallel"
29 exit 1
30fi
31
32if test ! -x `which gnunet-service-dht`
33then
34 echo "This script requires gnunet-service-dht in \$PATH"
35 exit 1
36fi
37
38if test ! -x `which gnunet-dht-hello`
39then
40 echo "This script requires gnunet-dht-hello in \$PATH"
41 exit 1
42fi
43
44MAX=`expr $1 - 1`
45
46# export GNUNET_FORCE_LOG="dht*;;;;DEBUG"
47
48echo -n "Starting $1 peers "
49mkdir -p /tmp/deployment
50for n in `seq 0 $MAX`
51do
52 PORT=`expr $MINPORT + $n`
53 CFG="/tmp/deployment/${n}.conf"
54 cat dhtu_testbed_deploy.conf | sed -e "s/%N%/$PORT/" > $CFG
55 gnunet-service-dht -c $CFG &> /tmp/deployment/$n.log &
56 echo -n "."
57done
58
59echo ""
60echo "$1 peers ready".
61
62unset GNUNET_FORCE_LOG
63
64function connect()
65{
66 n=$1
67}
68
69echo -n "Connecting peers ..."
70
71export MAX
72if test 0 != $MAX
73then
74 seq 0 $MAX | parallel ./dhtu_testbed_connect.sh :::
75fi
76
77
78echo ""
79echo "Network ready. Press ENTER to terminate the testbed!"
80echo "Interact with peers using '-c /tmp/deployment/\$N.conf'"
81
82read
83
84exit 0