68 lines
1.1 KiB
Bash
68 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Starts mDNSResponderPosix and mdnsd
|
|
#
|
|
|
|
umask 077
|
|
|
|
start() {
|
|
echo -n "Starting mdnsd: "
|
|
start-stop-daemon --start --quiet --pidfile /var/run/mdnsd.pid \
|
|
--exec /usr/sbin/mdnsd
|
|
if [ "$?" != "0" ] ; then
|
|
echo "FAIL"
|
|
return 1
|
|
fi
|
|
echo "OK"
|
|
|
|
echo -n "Starting mDNSResponderPosix: "
|
|
start-stop-daemon --start --quiet --pidfile /var/run/mDNSResponderPosix.pid \
|
|
--exec /usr/sbin/mDNSResponderPosix \
|
|
-- -b -f /etc/mDNSResponderPosix.conf -P /var/run/mDNSResponderPosix.pid
|
|
if [ "$?" != "0" ] ; then
|
|
echo "FAIL"
|
|
return 1
|
|
fi
|
|
echo "OK"
|
|
}
|
|
stop() {
|
|
echo -n "Stopping mDNSResponderPosix: "
|
|
start-stop-daemon --stop --quiet --pidfile /var/run/mDNSResponderPosix.pid
|
|
if [ "$?" != "0" ] ; then
|
|
echo "FAIL"
|
|
return 1
|
|
fi
|
|
echo "OK"
|
|
|
|
echo -n "Stopping mdnsd: "
|
|
start-stop-daemon --stop --quiet --pidfile /var/run/mdnsd.pid
|
|
if [ "$?" != "0" ] ; then
|
|
echo "FAIL"
|
|
return 1
|
|
fi
|
|
echo "OK"
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
restart
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|
|
|