packages/btpd: use new service functions
git-svn-id: svn://svn.openwrt.org/openwrt/packages@29055 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
f6164664c6
commit
ee71a2638d
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=btpd
|
PKG_NAME:=btpd
|
||||||
PKG_VERSION:=0.16
|
PKG_VERSION:=0.16
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://github.com/downloads/btpd/btpd
|
PKG_SOURCE_URL:=https://github.com/downloads/btpd/btpd
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
# Copyright (C) 2006-2010 OpenWrt.org
|
# Copyright (C) 2006-2011 OpenWrt.org
|
||||||
|
|
||||||
START=99
|
START=99
|
||||||
|
|
||||||
append_bool() {
|
append_bool() {
|
||||||
@ -21,10 +22,11 @@ append_parm() {
|
|||||||
append args "$switch $_loctmp"
|
append args "$switch $_loctmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
directory=""
|
|
||||||
|
|
||||||
btpd() {
|
btpd() {
|
||||||
local cfg="$1"
|
local cfg="$1"
|
||||||
|
args=""
|
||||||
|
directory=""
|
||||||
append_bool "$cfg" useipv4 "-4"
|
append_bool "$cfg" useipv4 "-4"
|
||||||
append_bool "$cfg" useipv6 "-6"
|
append_bool "$cfg" useipv6 "-6"
|
||||||
append_bool "$cfg" emptystart "--empty-start"
|
append_bool "$cfg" emptystart "--empty-start"
|
||||||
@ -38,30 +40,22 @@ btpd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
include /lib/network
|
|
||||||
config_load btpd
|
config_load btpd
|
||||||
args=""
|
|
||||||
config_foreach btpd btpd
|
config_foreach btpd btpd
|
||||||
/usr/bin/btpd $args
|
|
||||||
|
service_start /usr/bin/btpd $args
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
include /lib/network
|
|
||||||
config_load btpd
|
config_load btpd
|
||||||
args=""
|
|
||||||
config_foreach btpd btpd
|
config_foreach btpd btpd
|
||||||
|
|
||||||
[ -d $directory ] && args="-d $directory "
|
[ -d $directory ] && args="-d $directory "
|
||||||
echo -n "stop btpd "
|
|
||||||
|
|
||||||
while btcli $args kill ; do
|
while btcli $args kill ; do
|
||||||
echo -n .
|
|
||||||
sleep 3
|
sleep 3
|
||||||
done 2>/dev/null
|
done 2>/dev/null
|
||||||
|
|
||||||
killall /usr/bin/btpd > /dev/null 2>&1
|
service_stop /usr/bin/btpd
|
||||||
|
|
||||||
echo " done"
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user