Junxiao Shi | d71d84c | 2014-04-18 17:22:50 -0700 | [diff] [blame] | 1 | #!@BASH@ |
2 | |||||
3 | hasProcess() { | ||||
4 | local processName=$1 | ||||
5 | |||||
6 | if pgrep -x $processName >/dev/null | ||||
7 | then | ||||
8 | echo $processName | ||||
9 | fi | ||||
10 | } | ||||
11 | |||||
12 | hasNFD=$(hasProcess nfd) | ||||
13 | hasNRD=$(hasProcess nrd) | ||||
14 | |||||
15 | if [[ -n $hasNFD$hasNRD ]] | ||||
16 | then | ||||
17 | echo 'NFD or NRD is already running...' | ||||
18 | exit 1 | ||||
19 | fi | ||||
20 | |||||
21 | sudo nfd & | ||||
22 | sleep 2 | ||||
23 | nrd & | ||||
24 | sleep 2 |