vnstat: update init script to use latest service functions

This is just a simple patch to update vnstatd to use the latest
service functions.

Signed-off-by: Joe Roback <openwrt-devel@roback.cc>
Signed-off-by: Florian Fainelli <florian@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@35233 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2013-01-18 16:34:34 +00:00
parent 6f31017731
commit 1dcbfaeeca

@ -65,13 +65,18 @@ start() {
config_load vnstat config_load vnstat
config_foreach init_ifaces vnstat config_foreach init_ifaces vnstat
/usr/sbin/vnstatd -d SERVICE_PID_FILE="${pid}"
service_start /usr/sbin/vnstatd -d
} }
stop() { stop() {
local pid="$(vnstat_option PidFile)" local pid="$(vnstat_option PidFile)"
[ -n "$pid" ] && {
service_kill vnstatd "$pid" [ -n "$pid" ] || {
rm -f "$pid" echo "Error: No PidFile set in vnstat.conf" >&2
exit 1
} }
SERVICE_PID_FILE="${pid}"
service_stop /usr/sbin/vnstatd
} }