-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·55 lines (41 loc) · 766 Bytes
/
start.sh
File metadata and controls
executable file
·55 lines (41 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# start.sh
# (C) 2009, Michael Meier
nums="1 2 3 4"
min=8003
max=8102
# glorious mac os x does not offer a seq command, so here we go...
counter=$min
while [ $counter -le $max ]; do
# echo $counter
sn="$sn $counter"
counter=$(expr $counter + 1)
done
#sn="8003 8004 8005 8006 8007 8008 8009 8010"
#sn="8012"
cleanup() {
for pid in $pids; do
echo $pid
# how rude
kill -9 $pid
done;
exit 0
}
trap cleanup SIGINT SIGTERM
for n in $sn; do
./kademlua $n > log/$n &
#sleep 1$n &
sleep 0.1
echo started kademlua with port number $n
npid=$!
pids="$pids $npid"
done
sleep 0.2
for port in $sn; do
echo -n $port " : "
echo -n $port | sha1sum | cut -d " " -f 1
done
while :
do
sleep 60
done