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="" |
| 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 |
| 39 | end script |