X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=net%2Fvnstat%2FMakefile;fp=net%2Fvnstat%2FMakefile;h=29995fc6a76323ddfa8eea679399ddf761fc12c4;hb=1ba7498ad0bfde50413f02b4f71955275054403e;hp=e0f364ca4977e207486e7e6c1cf45ee627abd6c6;hpb=89a970759d54ea7bd55cf0e34ac57a092c259b16;p=packages.git diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile index e0f364ca4..29995fc6a 100644 --- a/net/vnstat/Makefile +++ b/net/vnstat/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vnstat PKG_VERSION:=1.10 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://humdi.net/vnstat @@ -98,16 +98,14 @@ endef define Package/vnstat/postinst #!/bin/sh -BIN_REL=/usr/bin/vnstat -BIN=$${IPKG_INSTROOT}$${BIN_REL} -LIB_D_REL=/var/lib/vnstat -LIB_D=$${IPKG_INSTROOT}$${LIB_D_REL} -[ -d $$LIB_D ] || mkdir -p $$LIB_D -IFACE_WAN=$$(uci get network.wan.ifname) -if [ -n $$IFACE_WAN ]; then - [ -e $$LIB_D/$$IFACE_WAN ] || ( [ -x $$BIN ] && $$BIN -u -i $$IFACE_WAN ) +local wan="$$(uci -P/var/state get network.wan.ifname)" +if [ -n "$$wan" ]; then + uci -q batch <<-EOF >/dev/null + add_list vnstat.@vnstat[-1].interface=$$wan + commit vnstat + EOF fi -true +exit 0 endef $(eval $(call BuildPackage,vnstat))