blob: dc0bd7f47e6c60dc6775d03cc71eb60ebe83454b [file] [log] [blame]
description "NFD Autoreg Server"
author "Alexander Afanasyev <alexander.afanasyev@ucla.edu>"
start on started nrd
stop on stopping nrd
respawn
respawn limit unlimited
setuid ndn
setgid ndn
script
BLACKLIST=""
WHITELIST=""
ALL_FACES_PREFIXES=""
ON_DEMAND_FACES_PREFIXES=""
FLAGS=""
if [ -f /etc/default/nfd-autoreg ]; then
. /etc/default/nfd-autoreg
fi
blacklist=""
if [ "$BLACKLIST" != "" ]; then
blacklist=`for i in $BLACKLIST; do echo -n "-b $i "; done`
fi
whitelist=""
if [ "$WHITELIST" != "" ]; then
whitelist=`for i in $WHITELIST; do echo -n "-w $i "; done`
fi
all_prefixes=""
if [ "$ALL_FACES_PREFIXES" != "" ]; then
all_prefixes=`for i in $ALL_FACES_PREFIXES; do echo -n "--all-faces-prefix $i "; done`
fi
on_demand_prefixes=""
if [ "$ON_DEMAND_FACES_PREFIXES" != "" ]; then
on_demand_prefixes=`for i in $ON_DEMAND_FACES_PREFIXES; do echo -n "--prefix $i "; done`
fi
export HOME=/var/lib/ndn/nfd-autoreg
exec /usr/bin/nfd-autoreg $blacklist $whitelist $on_demand_prefixes $all_prefixes $FLAGS
end script