Add paths to PATH in shell script
[platform/upstream/mdnsresponder.git] / mdnsresponder-server.sh.in
1 #!/bin/sh
2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3
4 program="mdnsd"
5 target=`/bin/ps -eo comm|/bin/grep ${program}`
6
7 start_mdnsd()
8 {
9         if [ "X${target}" == "X" ]; then
10                 echo "${program} is not running"
11                 echo "Launching ${program}"
12                 /usr/sbin/${program}
13 #               /bin/sleep 1
14         else
15                 echo "${program} is already running"
16         fi
17 }
18
19 stop_mdnsd()
20 {
21         if [ "X${target}" == "X" ]; then
22                 echo "${program} is not running"
23         else
24                 echo "${program} is running.. Killing it"
25                 /usr/bin/pkill -x ${program}
26         fi
27 }
28
29 case $1 in
30 "start")
31 start_mdnsd
32 ;;
33 "stop")
34 stop_mdnsd
35 ;;
36 *)
37 /bin/echo mdnsd-server.sh [start/stop]
38 exit 1
39 ;;
40 esac