Files
linuxkit/alpine/etc/init.d/mdnstool
Justin Cormack 2a0f80b497 clean up rc files
Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-18 10:46:34 +00:00

38 lines
628 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
export HOSTNAME=$(hostname -s).local.
start-stop-daemon --start --quiet \
--background \
--exec /sbin/mdnstool \
--make-pidfile --pidfile ${PIDFILE} \
-- if eth0 -hostname ${HOSTNAME}
eend $? "Failed to start mDNS server"
}
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"
}