2009-01-26 17:58:13 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2011-06-09 00:34:46 +00:00
|
|
|
# Copyright (C) 2009-2011 OpenWrt.org
|
|
|
|
|
2009-01-26 17:58:13 +00:00
|
|
|
START=70
|
|
|
|
|
|
|
|
start() {
|
2011-06-09 00:34:46 +00:00
|
|
|
local pri_ip sec_ip pri_port sec_port
|
|
|
|
parse_opts() {
|
|
|
|
local cfg="$1"
|
|
|
|
config_get pri_ip "$cfg" primaryip
|
|
|
|
config_get sec_ip "$cfg" secondaryip
|
|
|
|
config_get pri_port "$cfg" primaryport
|
|
|
|
config_get sec_port "$cfg" secondaryport
|
|
|
|
}
|
2009-01-26 17:58:13 +00:00
|
|
|
|
2011-06-09 00:34:46 +00:00
|
|
|
config_load "stund"
|
|
|
|
config_foreach parse_opts
|
2009-01-26 17:58:13 +00:00
|
|
|
|
2011-06-09 00:34:46 +00:00
|
|
|
start-stop-daemon -S -p /var/run/stund.pid -m -b \
|
|
|
|
-x /usr/sbin/stund -- \
|
|
|
|
${pri_ip:+-h $pri_ip} ${sec_ip:+-a $sec_ip} \
|
|
|
|
${pri_port:+-p $pri_port} ${sec_port:+-o $sec_port}
|
2009-01-26 17:58:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2011-06-09 00:34:46 +00:00
|
|
|
service_kill stund /var/run/stund.pid
|
|
|
|
rm -f /var/run/stund.pid
|
2009-01-26 17:58:13 +00:00
|
|
|
}
|