packages/btpd: use new service functions
authornico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 13 Nov 2011 22:15:38 +0000 (22:15 +0000)
committernico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 13 Nov 2011 22:15:38 +0000 (22:15 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@29055 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/btpd/Makefile
net/btpd/files/btpd.init

index 14830d6..b98e148 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=btpd
 PKG_VERSION:=0.16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/downloads/btpd/btpd
index 8f266c6..867b553 100644 (file)
@@ -1,5 +1,6 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
+
 START=99
 
 append_bool() {
@@ -21,10 +22,11 @@ append_parm() {
        append args "$switch $_loctmp"
 }
 
-directory=""
 
 btpd() {
        local cfg="$1"
+       args=""
+       directory=""
        append_bool "$cfg" useipv4 "-4"
        append_bool "$cfg" useipv6 "-6"
        append_bool "$cfg" emptystart "--empty-start"
@@ -38,30 +40,22 @@ btpd() {
 }
 
 start() {
-       include /lib/network
        config_load btpd
-       args=""
        config_foreach btpd btpd
-       /usr/bin/btpd $args
+
+       service_start /usr/bin/btpd $args
 }
 
 stop() {
-       include /lib/network
        config_load btpd
-       args=""
        config_foreach btpd btpd
-       
+
        [ -d $directory ] && args="-d $directory "
-       echo -n "stop btpd "
-       
+
        while btcli $args kill ; do
-               echo -n .
                sleep 3
        done 2>/dev/null
-       
-       killall /usr/bin/btpd > /dev/null 2>&1
-       
-       echo " done"
-       return 0
+
+       service_stop /usr/bin/btpd
 }