tools: Automatically start ndn-autoconfig in nfd-start, if enabled in autoconfig.conf
Change-Id: I09d3fff87f00ce8684e6e304e8327f9d03ca18bf
Refs: #2716
diff --git a/tools/nfd-start.sh b/tools/nfd-start.sh
index 4c14e07..5283f19 100755
--- a/tools/nfd-start.sh
+++ b/tools/nfd-start.sh
@@ -51,7 +51,12 @@
sudo @BINDIR@/nfd &
if [ -f @SYSCONFDIR@/ndn/nfd-init.sh ]; then
- sleep 2 # post-start is executed just after nfd process starts, but there is no guarantee
- # that all initialization has been finished
- . @SYSCONFDIR@/ndn/nfd-init.sh
+ sleep 2 # post-start is executed just after nfd process starts, but there is no guarantee
+ # that all initialization has been finished
+ . @SYSCONFDIR@/ndn/nfd-init.sh
+fi
+
+if [ -f @SYSCONFDIR@/ndn/autoconfig.conf ]; then
+ sleep 2 # post-start is executed just after nfd process starts, but there is no guarantee
+ @BINDIR@/ndn-autoconfig -d -c "@SYSCONFDIR@/ndn/autoconfig.conf" &
fi