Alexander Afanasyev | 4c568f2 | 2014-05-23 17:18:06 -0700 | [diff] [blame] | 1 | description "NFD Autoreg Server" |
| 2 | author "Alexander Afanasyev <alexander.afanasyev@ucla.edu>" |
| 3 | |
| 4 | start on started nrd |
| 5 | stop on stopping nrd |
| 6 | |
| 7 | respawn |
| 8 | respawn limit unlimited |
| 9 | |
| 10 | setuid ndn |
| 11 | setgid ndn |
| 12 | |
| 13 | script |
| 14 | BLACKLIST="" |
| 15 | WHITELIST="" |
Alexander Afanasyev | f20be18 | 2014-08-14 18:46:41 -0700 | [diff] [blame] | 16 | ALL_FACES_PREFIXES="" |
| 17 | ON_DEMAND_FACES_PREFIXES="" |
Alexander Afanasyev | 4c568f2 | 2014-05-23 17:18:06 -0700 | [diff] [blame] | 18 | 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 Afanasyev | f20be18 | 2014-08-14 18:46:41 -0700 | [diff] [blame] | 33 | 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 Afanasyev | 4c568f2 | 2014-05-23 17:18:06 -0700 | [diff] [blame] | 41 | fi |
| 42 | |
| 43 | export HOME=/var/lib/ndn/nfd-autoreg |
Alexander Afanasyev | f20be18 | 2014-08-14 18:46:41 -0700 | [diff] [blame] | 44 | exec /usr/bin/nfd-autoreg $blacklist $whitelist $on_demand_prefixes $all_prefixes $FLAGS |
Alexander Afanasyev | 4c568f2 | 2014-05-23 17:18:06 -0700 | [diff] [blame] | 45 | end script |