-
Notifications
You must be signed in to change notification settings - Fork 2
/
manyserver_tbff
executable file
·67 lines (59 loc) · 1.32 KB
/
manyserver_tbff
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
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
CHUNK_SIZE=4096
#FILE=testfile10MB
FILE[0]=testfile1K
FILE[1]=testfile10K
FILE[2]=testfile50K
N_FILES=3
ICNID=ccn:/example1/mb1_ #.. il numero N_CONTENT
N_CONTENT=15
#FILE2=testfile10K
#ICNID2=ccn:/example/mb2
BASE_DIR=/root/alien-ofelia-conet-ccnx
#REP_DIR and FILE_DIR are relative to BASE_DIR
REP_DIR=ccnrep
FILE_DIR=content-files
if [ ! -n "$1" ]; then
echo "Uso parametri di default"
fi
while [ $# -gt 0 ]; do
if [ "$1" = "-cs" ]; then
if [ $# -lt 2 ]; then
usage
fi
CHUNK_SIZE=$2
shift 2
elif [ "$1" = "-f" ]; then
if [ $# -lt 2 ]; then
usage
fi
FILE=$2
shift 2
elif [ "$1" = "-n" ]; then
if [ $# -lt 2 ]; then
usage
fi
N_CONTENT=$2
shift 2
else
break
fi
done
if [ "$(pidof ccnd)" ];then
echo "Pid CCND: $(pidof ccnd)"
else
echo "Avvio CCND e attendo 10 sec"
$BASE_DIR/csrc/ccnd/ccnd 0 0 0 0 0 > /dev/null 2>&1 &
sleep 10
fi
cd $BASE_DIR/$REP_DIR
$BASE_DIR/csrc/ccnr/ccnr &
i="0"
while [ "$i" -lt "$N_CONTENT" ]; do
let "number= $i"
let "number %= $N_FILES"
echo "name: $ICNID$i"
$BASE_DIR/javasrc/tools/ccnputfile -javaopts -D"ccn.lib.blocksize=$CHUNK_SIZE" -unversioned $ICNID$i $BASE_DIR/$FILE_DIR/${FILE[$number]}
sleep 8
i=$[$i+1]
done