-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsingleclient
executable file
·47 lines (44 loc) · 961 Bytes
/
singleclient
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
#!/bin/bash
PAT=/root/alien-ofelia-conet-ccnx
SERVER=192.168.64.2
PORT=9699
NID=ccn:/example2/mb2_0
NID_CCNX=ccn:/example2
while [ $# -gt 0 ]; do
if [ "$1" = "-s" ]; then
if [ $# -lt 2 ]; then
usage
fi
SERVER=$2
shift 2
elif [ "$1" = "-nx" ]; then
if [ $# -lt 2 ]; then
usage
fi
NID_CCNX=$2
shift 2
elif [ "$1" = "-p" ]; then
if [ $# -lt 2 ]; then
usage
fi
PORT=$2
shift 2
elif [ "$1" = "-n" ]; then
if [ $# -lt 2 ]; then
usage
fi
NID=$2
shift 2
else
break
fi
done
if [ "$(pidof ccnd)" ];then
echo "Pid CCND: $(pidof ccnd)"
else
echo "Avvio CCND e attendo 10 sec"
$PAT/csrc/ccnd/ccnd 1 1 0 0 0 > /dev/null 2>&1 &
sleep 10
fi
$PAT/csrc/libexec/ccndc add $NID_CCNX udp $SERVER $PORT && $PAT/csrc/libexec/ccndc add ccnx:/ udp $SERVER
$PAT/csrc/cmd/ccncatchunks2 -d -p 20 -s $NID