blob: dc0bd7f47e6c60dc6775d03cc71eb60ebe83454b [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=""
Alexander Afanasyevf20be182014-08-14 18:46:41 -070016 ALL_FACES_PREFIXES=""
17 ON_DEMAND_FACES_PREFIXES=""
Alexander Afanasyev4c568f22014-05-23 17:18:06 -070018 FLAGS=""
19 if [ -f /etc/default/nfd-autoreg ]; then
20 . /etc/default/nfd-autoreg
21 fi
22
23 blacklist=""
24 if [ "$BLACKLIST" != "" ]; then
25 blacklist=`for i in $BLACKLIST; do echo -n "-b $i "; done`
26 fi
27
28 whitelist=""
29 if [ "$WHITELIST" != "" ]; then
30 whitelist=`for i in $WHITELIST; do echo -n "-w $i "; done`
31 fi
32
Alexander Afanasyevf20be182014-08-14 18:46:41 -070033 all_prefixes=""
34 if [ "$ALL_FACES_PREFIXES" != "" ]; then
35 all_prefixes=`for i in $ALL_FACES_PREFIXES; do echo -n "--all-faces-prefix $i "; done`
36 fi
37
38 on_demand_prefixes=""
39 if [ "$ON_DEMAND_FACES_PREFIXES" != "" ]; then
40 on_demand_prefixes=`for i in $ON_DEMAND_FACES_PREFIXES; do echo -n "--prefix $i "; done`
Alexander Afanasyev4c568f22014-05-23 17:18:06 -070041 fi
42
43 export HOME=/var/lib/ndn/nfd-autoreg
Alexander Afanasyevf20be182014-08-14 18:46:41 -070044 exec /usr/bin/nfd-autoreg $blacklist $whitelist $on_demand_prefixes $all_prefixes $FLAGS
Alexander Afanasyev4c568f22014-05-23 17:18:06 -070045end script