From 36a1eb8eb80f56d150aeab079be42d16a86445b1 Mon Sep 17 00:00:00 2001 From: BuGu <62454025+Z2Z-GuGu@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:07:06 +0800 Subject: [PATCH] Add startup scripts related to mDNS service. --- kvmapp/system/init.d/S50avahi-daemon | 20 +++++++++++++++++++ kvmapp/system/init.d/S80dnsmasq | 29 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 kvmapp/system/init.d/S50avahi-daemon create mode 100755 kvmapp/system/init.d/S80dnsmasq diff --git a/kvmapp/system/init.d/S50avahi-daemon b/kvmapp/system/init.d/S50avahi-daemon new file mode 100755 index 0000000..81ac513 --- /dev/null +++ b/kvmapp/system/init.d/S50avahi-daemon @@ -0,0 +1,20 @@ +#!/bin/sh +# +# avahi-daemon init script + +DAEMON=/usr/sbin/avahi-daemon +case "$1" in + start) + $DAEMON -c || $DAEMON -D + ;; + stop) + $DAEMON -c && $DAEMON -k + ;; + reload) + $DAEMON -c && $DAEMON -r + ;; + *) + echo "Usage: S50avahi-daemon {start|stop|reload}" >&2 + exit 1 + ;; +esac diff --git a/kvmapp/system/init.d/S80dnsmasq b/kvmapp/system/init.d/S80dnsmasq new file mode 100755 index 0000000..175daf9 --- /dev/null +++ b/kvmapp/system/init.d/S80dnsmasq @@ -0,0 +1,29 @@ +#!/bin/sh + +DAEMON="dnsmasq" +PIDFILE="/var/run/$DAEMON.pid" + +[ -f /etc/dnsmasq.conf ] || exit 0 + +case "$1" in + start) + printf "Starting dnsmasq: " + start-stop-daemon -S -p "$PIDFILE" -x "/usr/sbin/$DAEMON" -- \ + --pid-file="$PIDFILE" + [ $? = 0 ] && echo "OK" || echo "FAIL" + ;; + stop) + printf "Stopping dnsmasq: " + start-stop-daemon -K -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" + [ $? = 0 ] && echo "OK" || echo "FAIL" + ;; + restart|reload) + $0 stop + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit 0