-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsingleserver
executable file
·59 lines (51 loc) · 1.27 KB
/
singleserver
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
#!/bin/bash
#it loads one file
#it can load two files if some lines will be uncommented
CHUNK_SIZE=4096
#FILE=testfile10MB
FILE=testfile1K
ICNID=ccn:/example/mb1
#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
ICNID=$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 &
$BASE_DIR/javasrc/tools/ccnputfile -javaopts -D"ccn.lib.blocksize=$CHUNK_SIZE" -unversioned $ICNID $BASE_DIR/$FILE_DIR/$FILE
#sleep 8
#$BASE_DIR/javasrc/tools/ccnputfile -javaopts -D"ccn.lib.blocksize=$CHUNK_SIZE" -unversioned $ICNID2 $BASE_DIR/$FILE_DIR/$FILE2