blob: 8c22c43ecd3a5ec09d55fc1d3160ff7465a7425d [file] [log] [blame]
Alexander Afanasyev4c568f22014-05-23 17:18:06 -07001description "NFD Autoreg Server"
2author "Alexander Afanasyev <alexander.afanasyev@ucla.edu>"
3
4start on started nrd
5stop on stopping nrd
6
7respawn
8respawn limit unlimited
9
10setuid ndn
11setgid ndn
12
13script
14 BLACKLIST=""
15 WHITELIST=""
16 PREFIXES=""
17 FLAGS=""
18 if [ -f /etc/default/nfd-autoreg ]; then
19 . /etc/default/nfd-autoreg
20 fi
21
22 blacklist=""
23 if [ "$BLACKLIST" != "" ]; then
24 blacklist=`for i in $BLACKLIST; do echo -n "-b $i "; done`
25 fi
26
27 whitelist=""
28 if [ "$WHITELIST" != "" ]; then
29 whitelist=`for i in $WHITELIST; do echo -n "-w $i "; done`
30 fi
31
32 prefixes=""
33 if [ "$PREFIXES" != "" ]; then
34 prefixes=`for i in $PREFIXES; do echo -n "--prefix $i "; done`
35 fi
36
37 export HOME=/var/lib/ndn/nfd-autoreg
38 exec /usr/bin/nfd-autoreg $blacklist $whitelist $prefixes $FLAGS
39end script