[packages] darkstat: use network.sh to find devices
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 29 May 2012 01:15:35 +0000 (01:15 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 29 May 2012 01:15:35 +0000 (01:15 +0000)
SVN-Revision: 31969

net/darkstat/Makefile
net/darkstat/files/darkstat.init

index 7f170a630224d5c0e201a640ad814d4a7895dbb2..f0013c9a7c8bb70f5dc6e6de86dde8e9b79da69a 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=darkstat
 PKG_VERSION:=3.0.715
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://unix4lyfe.org/darkstat
index 93bee6b61955cf2f6332ce94631c7275e202b292..8499e3e4d42675fa1f87f153dafdf7c4cb872b20 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2007-2011 OpenWrt.org
+# Copyright (C) 2007-2012 OpenWrt.org
 
 START=60
 RUN_D=/var/empty
@@ -7,8 +7,7 @@ PID_F=$RUN_D/darkstat.pid
 
 start() {
        mkdir -p $RUN_D
-       include /lib/network
-       scan_interfaces
+       . /lib/functions/network.sh
        config_load darkstat
        config_foreach start_darkstat darkstat
 }
@@ -19,14 +18,14 @@ start_darkstat() {
        config_get httpaddr "$cfg" httpaddr
        config_get httpport "$cfg" httpport
 
-       config_get ifname "$interface" ifname
-
-       /usr/sbin/darkstat --verbose \
-               -i "$ifname" \
-               ${httpaddr:+-b "$httpaddr"} \
-               ${httpport:+-p "$httpport"} \
-               --chroot $RUN_D \
-               --pidfile $PID_F
+       network_get_device ifname "$interface" && {
+               /usr/sbin/darkstat --verbose \
+                       -i "$ifname" \
+                       ${httpaddr:+-b "$httpaddr"} \
+                       ${httpport:+-p "$httpport"} \
+                       --chroot $RUN_D \
+                       --pidfile $PID_F
+       }
 }
 
 stop() {