tools: NFD startup script
`nfd-start` starts NFD and RIB daemon.
`nfd-stop` stops NFD and RIB daemon.
They are intended for source installation only.
Binary packages should prefer to use system service mechanism if available.
refs #1488
Change-Id: I09f2168619a47fdc0faa78079b7994f30f41ff75
diff --git a/tools/nfd-start.sh b/tools/nfd-start.sh
new file mode 100755
index 0000000..ed16690
--- /dev/null
+++ b/tools/nfd-start.sh
@@ -0,0 +1,24 @@
+#!@BASH@
+
+hasProcess() {
+ local processName=$1
+
+ if pgrep -x $processName >/dev/null
+ then
+ echo $processName
+ fi
+}
+
+hasNFD=$(hasProcess nfd)
+hasNRD=$(hasProcess nrd)
+
+if [[ -n $hasNFD$hasNRD ]]
+then
+ echo 'NFD or NRD is already running...'
+ exit 1
+fi
+
+sudo nfd &
+sleep 2
+nrd &
+sleep 2