mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 13:48:06 +00:00
umdns: add support to enable/disable mdns
update init script to: * add support for enabling or disabling umdns * add support for reload Signed-off-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
This commit is contained in:
parent
8a7239009c
commit
bc49bcd611
@ -18,6 +18,11 @@ load_ifaces() {
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
configure_interfaces() {
|
||||
json_init
|
||||
json_add_array interfaces
|
||||
for i in $(load_ifaces); do
|
||||
@ -29,6 +34,12 @@ reload_service() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local disabled="$(uci -q get umdns.@umdns[-1].disabled)"
|
||||
|
||||
if [ "${disabled}" = "1" ] || [ "${disabled}" = "true" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local network="$(uci -q get umdns.@umdns[-1].network)"
|
||||
|
||||
procd_open_instance
|
||||
@ -46,10 +57,16 @@ start_service() {
|
||||
procd_add_jail umdns ubus log
|
||||
[ -d /etc/umdns ] && procd_add_jail_mount "/etc/umdns"
|
||||
}
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger umdns
|
||||
}
|
||||
|
||||
service_started() {
|
||||
ubus -t 10 wait_for umdns
|
||||
[ $? = 0 ] && reload_service
|
||||
[ $? = 0 ] && configure_interfaces
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user