Files
linuxkit/alpine/etc/init.d/mdnstool
2015-12-11 14:42:37 +00:00

37 lines
656 B
Plaintext
Executable File

#!/sbin/openrc-run
description="mDNS server"
depend()
{
need 9pinit net
after firewall
}
start()
{
ebegin "Starting mDNS server"
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/mdnstool.pid
HOSTNAME=$(hostname -s).local.
# start-stop-daemon --start --quiet \
# --exec /sbin/mdnstool \
# --pidfile "${PIDFILE}" \
# -- if eth0 -hostname ${HOSTNAME}
# eend $? "Failed to start mDNS server"
/sbin/mdnstool if eth0 -hostname ${HOSTNAME} -detach &
}
stop()
{
ebegin "Stopping mDNS server"
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/mdnstool.pid
start-stop-daemon --stop --quiet \
--pidfile "${PIDFILE}"
eend $? "Failed to stop mDNS server"
}