packages/stun: use new service functions

git-svn-id: svn://svn.openwrt.org/openwrt/packages@29095 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2011-11-14 02:38:44 +00:00
parent 67ddcf9a51
commit 1a0b18f7f6
2 changed files with 12 additions and 10 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=stund
PKG_VERSION:=0.96
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_Aug13.tgz
PKG_SOURCE_URL:=@SF/stun

View File

@ -3,26 +3,28 @@
START=70
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
start() {
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
config_get pri_ip "$cfg" 'primaryip'
config_get sec_ip "$cfg" 'secondaryip'
config_get pri_port "$cfg" 'primaryport'
config_get sec_port "$cfg" 'secondaryport'
}
config_load "stund"
config_load 'stund'
config_foreach parse_opts
start-stop-daemon -S -p /var/run/stund.pid -m -b \
-x /usr/sbin/stund -- \
service_start /usr/sbin/stund \
${pri_ip:+-h $pri_ip} ${sec_ip:+-a $sec_ip} \
${pri_port:+-p $pri_port} ${sec_port:+-o $sec_port}
}
stop() {
service_kill stund /var/run/stund.pid
rm -f /var/run/stund.pid
service_stop /usr/sbin/stund
}