blob: 9fe9424d0c5e93bc2b5a8b0ef271817a8a76c72d [file] [log] [blame]
#!@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
if ! ndnsec-get-default &>/dev/null
then
ndnsec-keygen /localhost/operator | ndnsec-install-cert -
fi
if ! sudo true
then
echo 'Unable to obtain superuser privilege'
exit 2
fi
sudo nfd &
sleep 2
nrd &
sleep 2