vnstat: remove package

vnstat 1.18 dates from 2018, and upstream has since moved to the 2.x
series, which is packaged as vnstat2. Nothing in the feeds depends on
vnstat; luci-app-vnstat2 already uses vnstat2.

The next commit lets vnstat2 provide vnstat, so existing installations
are upgraded to it.

Signed-off-by: Sander van Deijck <sander@vandeijck.com>
This commit is contained in:
Sander van Deijck authored and Hannu Nyman committed 2026-10-24 10:12:34 +03:00
1 parent 2d8688b209
commit 207fb2c2fe
5 files changed
-242

No files matched your search

-110
View File
@@ -1,110 +0,0 @@
#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=vnstat
PKG_VERSION:=1.18
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://humdi.net/vnstat
PKG_HASH:=d7193592b9e7445fa5cbe8af7d3b39982f165ee8fc58041ff41f509b37c687d5
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=libgd
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/vnstat/Default
SECTION:=net
CATEGORY:=Network
URL:=https://humdi.net/vnstat/
endef
define Package/vnstat
$(call Package/vnstat/Default)
TITLE:=Console-based network traffic monitor
endef
define Package/vnstat/description
vnStat is a network traffic monitor for Linux that keeps a log of daily
network traffic for the selected interface(s). vnStat isn't a packet
sniffer. The traffic information is analyzed from the /proc -filesystem,
so vnStat can be used without root permissions.
endef
define Package/vnstati
$(call Package/vnstat/Default)
DEPENDS+=vnstat +libgd
TITLE:=PNG image output support for vnStat
endef
define Package/vnstati/description
The purpose of vnstati is to provide image output support for statistics
collected using vnstat(1). However, the image file format is limited to
png. All basic outputs of vnStat are supported excluding live traffic
features. The image can be outputted either to a file or to standard
output.
endef
define Package/vnstat/conffiles
/etc/vnstat.conf
/etc/config/vnstat
endef
define Build/Compile/vnstat
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
endef
define Build/Compile/vnstati
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
LDFLAGS="$(TARGET_LDFLAGS)" \
all
endef
define Build/Compile
$(call Build/Compile/vnstat)
$(call Build/Compile/vnstati)
endef
define Package/vnstat/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/vnstat $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/vnstatd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) $(PKG_BUILD_DIR)/cfg/vnstat.conf $(1)/etc/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/vnstat.config $(1)/etc/config/vnstat
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/vnstat.init $(1)/etc/init.d/vnstat
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/vnstat.defaults $(1)/etc/uci-defaults/vnstat
endef
define Package/vnstati/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/vnstati $(1)/usr/bin/
endef
define Package/vnstat/postinst
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || (. /etc/uci-defaults/vnstat) && rm -f /etc/uci-defaults/vnstat
exit 0
endef
$(eval $(call BuildPackage,vnstat))
$(eval $(call BuildPackage,vnstati))
-5
View File
@@ -1,5 +0,0 @@
config vnstat
list interface br-lan
# list interface eth0.1
# option remote http://example.org/vnstat/
# option symlink /www/vnstat
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh
wan="$(uci -P/var/state get network.wan.ifname)"
if [ -n "$wan" ]; then
uci -q batch <<-EOF >/dev/null
del_list vnstat.@vnstat[-1].interface=$wan
add_list vnstat.@vnstat[-1].interface=$wan
commit vnstat
EOF
fi
exit 0
-86
View File
@@ -1,86 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2011 OpenWrt.org
START=99
USE_PROCD=1
vnstat_option() {
sed -ne "s/^[[:space:]]*$1[[:space:]]*['\"]\([^'\"]*\)['\"].*/\1/p" \
/etc/vnstat.conf
}
start_service() {
local lib="$(vnstat_option DatabaseDir)"
[ -n "$lib" ] || {
echo "Error: No DatabaseDir set in vnstat.conf" >&2
exit 1
}
mkdir -p "$lib"
init_ifaces() {
local cfg="$1"
local url lnk
init_iface() {
local ifn="$1"
if [ -n "$url" ]; then
local try=0
local max=3
local hostname="$(cat /proc/sys/kernel/hostname)"
while [ $((++try)) -le $max ]; do
if wget -q -O "$lib/$ifn" "$url/${hostname}_$ifn" 2>/dev/null && [ -e "$lib/$ifn" ]; then
logger -t "vnstat" "Downloaded backup for database $ifn"
break
else
logger -t "vnstat" "Download try $try/$max for database $ifn failed"
sleep 30
fi
done
elif [ -n "$backup_dir" ]; then
if cp -f "$backup_dir/$ifn" "$lib/" &>/dev/null; then
logger -t "vnstat" "Restored backup for database $ifn"
else
logger -t "vnstat" "Restore of backup for database $ifn failed"
fi
fi
/usr/bin/vnstat -u -i "$ifn" >/dev/null
[ -n "$lnk" ] && {
mkdir -p "$lnk"
[ -L "$lnk/$ifn" ] || ln -s "$lib/$ifn" "$lnk/$ifn"
}
}
config_get url "$cfg" remote
config_get lnk "$cfg" symlink
config_get backup_dir "$cfg" backup_dir
config_list_foreach "$cfg" interface init_iface
return 1
}
config_load vnstat
config_foreach init_ifaces vnstat
procd_open_instance
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param command /usr/sbin/vnstatd --nodaemon
procd_set_param file /etc/vnstat.conf
procd_set_param respawn
procd_close_instance
}
reload_service() {
procd_send_signal vnstat
}
service_triggers() {
procd_add_reload_trigger vnstat
}
@@ -1,28 +0,0 @@
From: Jo-Philipp Wich <jo@mein.io>
Date: Thu, 26 Jan 2017 15:30:00 +0100
Subject: [PATCH] config: adjust default values
Adjust the default interval settings to be better suited for slower embedded
devices.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/cfg/vnstat.conf
+++ b/cfg/vnstat.conf
@@ -98,13 +98,13 @@ DaemonGroup ""
TimeSyncWait 5
# how often (in seconds) interface data is updated
-UpdateInterval 30
+UpdateInterval 60
# how often (in seconds) interface status changes are checked
-PollInterval 5
+PollInterval 30
# how often (in minutes) data is saved to file
-SaveInterval 5
+SaveInterval 30
# how often (in minutes) data is saved when all interface are offline
OfflineSaveInterval 30