#!/bin/sh /etc/rc.common
|
|
|
|
USE_PROCD=1
|
|
|
|
START=50
|
|
STOP=50
|
|
|
|
PROG=/usr/sbin/dawn
|
|
NAME=dawn
|
|
|
|
reload_service()
|
|
{
|
|
if service_running; then
|
|
ubus call dawn reload_config
|
|
else
|
|
start
|
|
fi
|
|
}
|
|
|
|
service_triggers()
|
|
{
|
|
procd_add_reload_trigger "dawn"
|
|
}
|
|
|
|
start_service()
|
|
{
|
|
local _tcp_buffer
|
|
config_load dawn
|
|
load_tcp_port() {
|
|
config_get _tcp_buffer "$1" tcp_port
|
|
}
|
|
config_foreach load_tcp_port network
|
|
|
|
touch /tmp/dawn_mac_list
|
|
|
|
echo "Starting Service..."
|
|
procd_open_instance
|
|
procd_set_param command $PROG
|
|
procd_set_param stdout 0 # here it is possible to remove the debug output...
|
|
procd_set_param stderr 1
|
|
procd_add_mdns "dawn" "tcp" "${_tcp_buffer}"
|
|
procd_close_instance
|
|
echo "Dawn instance started!"
|
|
echo "UMDNS with port ${_tcp_buffer}"
|
|
}
|
|
|