Added service file and package generation
This commit is contained in:
parent
cfdf09a1dc
commit
7223f118a7
8
Makefile
8
Makefile
@ -21,7 +21,7 @@ BIN=testmdnsd
|
||||
|
||||
LIBTINYSVCMDNS_OBJS = mdns.o mdnsd.o
|
||||
|
||||
.PHONY: all clean
|
||||
.PHONY: all clean opkg
|
||||
|
||||
all: $(BIN) libtinysvcmdns.a
|
||||
|
||||
@ -44,4 +44,10 @@ libtinysvcmdns.a: $(patsubst %, libtinysvcmdns.a(%), $(LIBTINYSVCMDNS_OBJS))
|
||||
|
||||
mdnsd: testmdnsd
|
||||
strip -o $@ $<
|
||||
install -C -D -p mdnsd sbin/
|
||||
|
||||
opkg: mdnsd $(wildcard opkg/CONTROL/*) etc/init.d/S80mdnsd
|
||||
install -D -p mdnsd opkg/sbin
|
||||
install -D -p etc/init.d/S80mdnsd opkg/etc/init.d/
|
||||
opkg-pack opkg
|
||||
|
||||
|
32
etc/init.d/S80mdnsd
Executable file
32
etc/init.d/S80mdnsd
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
# Wait for network to come up...
|
||||
(
|
||||
while [ ! -f /tmp/if-up ]; do
|
||||
echo "mdnsd: waiting for network..."
|
||||
sleep 1
|
||||
done
|
||||
|
||||
interface="`/sbin/route | /bin/sed -n '$ {
|
||||
s/.* //
|
||||
p
|
||||
}'`"
|
||||
echo " MDNS interface: [$interface]"
|
||||
[ -z "$interface" ] && interface=eth0
|
||||
|
||||
/bin/ip route add 224.0.0.0/4 dev $interface
|
||||
/mod/sbin/mdnsd &
|
||||
) &
|
||||
;;
|
||||
stop)
|
||||
killall -q mdnsd
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
8
opkg/CONTROL/control
Normal file
8
opkg/CONTROL/control
Normal file
@ -0,0 +1,8 @@
|
||||
Package: zeroconf
|
||||
Priority: optional
|
||||
Section: net
|
||||
Version: 1.5-2
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hummypkg.org.uk
|
||||
Depends:
|
||||
Description: MDNS & LLMNR Responder
|
6
opkg/CONTROL/postinst
Executable file
6
opkg/CONTROL/postinst
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
/mod/etc/init.d/S80mdnsd start < /dev/null > /dev/null 2>&1
|
||||
|
||||
exit 0
|
||||
|
6
opkg/CONTROL/prerm
Executable file
6
opkg/CONTROL/prerm
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
/mod/etc/init.d/S80mdnsd stop
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user