2017-02-23 14:49:32 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
|
|
|
|
START=55
|
|
|
|
|
|
|
|
USE_PROCD=1
|
|
|
|
PROG=/usr/sbin/l3roamd
|
|
|
|
|
|
|
|
start_service () {
|
2018-04-15 10:49:52 +00:00
|
|
|
local interfaces=$(
|
|
|
|
for dev in $(gluon-list-mesh-interfaces); do echo " -m $dev"; done
|
|
|
|
[ "$(ifstatus local_node | jsonfilter -e '@.up')" = 'true' ] && echo ' -i local-node'
|
|
|
|
)
|
2018-02-16 22:12:38 +00:00
|
|
|
/sbin/sysctl -w net.ipv6.neigh.default.gc_thresh1=2
|
|
|
|
/sbin/sysctl -w net.ipv4.neigh.default.gc_thresh1=2
|
2018-04-15 10:49:52 +00:00
|
|
|
|
2017-02-23 14:49:32 +00:00
|
|
|
procd_open_instance
|
|
|
|
procd_set_param stdout 1
|
|
|
|
procd_set_param stderr 1
|
|
|
|
procd_set_param respawn ${respawn_threshold:-3660} ${respawn_timeout:-5} ${respawn_retry:-0}
|
2017-06-14 17:40:59 +00:00
|
|
|
procd_set_param command "$PROG" -s /var/run/l3roamd.sock -p $(lua -e 'print(require("gluon.site").prefix6())') $interfaces -t 254 -a $(uci get network.loopback.ip6addr | cut -d/ -f1) -4 0:0:0:0:0:ffff::/96 -b br-client
|
2017-02-23 14:49:32 +00:00
|
|
|
procd_close_instance
|
|
|
|
}
|
|
|
|
|
|
|
|
service_triggers() {
|
|
|
|
local script=$(readlink "$initscript")
|
|
|
|
local name=$(basename "${script:-$initscript}")
|
|
|
|
|
|
|
|
procd_open_trigger
|
2018-04-15 10:49:52 +00:00
|
|
|
procd_add_raw_trigger 'interface.*' 0 "/etc/init.d/$name" reload
|
2017-02-23 14:49:32 +00:00
|
|
|
procd_close_trigger
|
|
|
|
}
|