1 #!/bin/sh /etc/rc.common
2 # Copyright (c) 2014 OpenWrt.org
4 . /lib/functions/network.sh
13 local network="$(uci get mdns.@mdns[-1].network)"
16 json_load "$(ifstatus $n)"
17 json_get_var device l3_device
24 json_add_array interfaces
25 for i in $(load_ifaces); do
26 json_add_string "" "$i"
30 ubus call mdns set_config "$(json_dump)"
34 local network="$(uci get mdns.@mdns[-1].network)"
37 procd_set_param command "$PROG"
38 procd_set_param seccomp /etc/seccomp/mdns.json
39 procd_set_param respawn
41 procd_add_config_trigger "config.change" "mdns" /etc/init.d/mdns reload
43 procd_add_interface_trigger "interface.*" $n /etc/init.d/mdns reload
45 procd_add_raw_trigger "instance.update" 5000 "/bin/ubus" "call" "mdns" "reload"
47 [ "$(uci get mdns.@mdns[-1].jail)" = 1 ] && procd_add_jail mdns ubus log
52 ubus -t 10 wait_for mdns
53 [ $? = 0 ] && reload_service