-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsingleintermedio
executable file
·47 lines (43 loc) · 933 Bytes
/
singleintermedio
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=/home/stefano/workspace/ccnx071base-cp-raw
SERVER=192.168.1.229
PORT=9699
NID=ccn:/example/mb1
NID_CCNX=ccn:/example
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)"
sudo kill "$(pidof ccnd)"
fi
echo "Avvio CCND e attendo 5 sec"
sudo $PAT/csrc/ccnd/ccnd 1 1 0 0 0 &
sleep 5
$PAT/csrc/libexec/ccndc add $NID_CCNX udp $SERVER $PORT && $PAT/csrc/libexec/ccndc add ccnx:/ udp $SERVER