[packages_10.03.2] stun: merge r29095, r29199
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 5 Feb 2012 16:14:40 +0000 (16:14 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 5 Feb 2012 16:14:40 +0000 (16:14 +0000)
SVN-Revision: 30265

net/stun/Makefile
net/stun/files/stund.init

index b0ac419df2c62034e690a5e2cb7225e124998a2d..e7090bf660c82ef57952b2bc541aff079e2cc1fb 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=stund
 PKG_VERSION:=0.96
-PKG_RELEASE:=3
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_Aug13.tgz
 PKG_SOURCE_URL:=@SF/stun
@@ -73,6 +73,10 @@ define Package/stund/install
        $(INSTALL_DATA) ./files/stund.config $(1)/etc/config/stund
 endef
 
+define Package/stund/conffiles
+/etc/config/stund
+endef
+
 define Package/stun-client/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/client $(1)/usr/sbin/stun-client
index 177ae58f5270a54119df371e778d3cfd952ab587..1deada499fb73860372ce94f7b335c9899f98ee3 100644 (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
 }