blob: 9fe9424d0c5e93bc2b5a8b0ef271817a8a76c72d [file] [log] [blame]
Junxiao Shid71d84c2014-04-18 17:22:50 -07001#!@BASH@
2
3hasProcess() {
4 local processName=$1
5
6 if pgrep -x $processName >/dev/null
7 then
8 echo $processName
9 fi
10}
11
12hasNFD=$(hasProcess nfd)
13hasNRD=$(hasProcess nrd)
14
15if [[ -n $hasNFD$hasNRD ]]
16then
17 echo 'NFD or NRD is already running...'
18 exit 1
19fi
20
Junxiao Shi262f5312014-05-03 10:45:12 -070021if ! ndnsec-get-default &>/dev/null
22then
23 ndnsec-keygen /localhost/operator | ndnsec-install-cert -
24fi
25
26if ! sudo true
27then
28 echo 'Unable to obtain superuser privilege'
29 exit 2
30fi
31
Junxiao Shid71d84c2014-04-18 17:22:50 -070032sudo nfd &
33sleep 2
34nrd &
35sleep 2