From eab817386b2a4c103b0ee4a601010c6b31de1c4d Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 22 Nov 2018 14:12:49 +0000 Subject: net/vnstat: Update rc script to correctly import old data into new database format --- net/vnstat/Makefile | 2 +- net/vnstat/files/vnstat.in | 26 +------------------------- 2 files changed, 2 insertions(+), 26 deletions(-) (limited to 'net/vnstat') diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile index 000fbf5bc658..a5578205ca8f 100644 --- a/net/vnstat/Makefile +++ b/net/vnstat/Makefile @@ -3,7 +3,7 @@ PORTNAME= vnstat PORTVERSION= 2.0 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://humdi.net/vnstat/ \ https://source.ipfire.org/source-2.x/ diff --git a/net/vnstat/files/vnstat.in b/net/vnstat/files/vnstat.in index 118db4eccfe2..f0282fa86ca3 100644 --- a/net/vnstat/files/vnstat.in +++ b/net/vnstat/files/vnstat.in @@ -9,7 +9,6 @@ # Add the following line to /etc/rc.conf to enable vnstat: # # vnstat_enable="YES" -# vnstat_additional_ifaces="em1" . /etc/rc.subr @@ -20,7 +19,7 @@ load_rc_config $name : ${vnstat_enable:=NO} : ${vnstat_pidfile=/var/run/vnstat/vnstat.pid} : ${vnstat_config=%%PREFIX%%/etc/vnstat.conf} -: ${vnstat_flags="-d --noadd"} +: ${vnstat_flags="-d"} : ${vnstat_user:=%%USERS%%} : ${vnstat_group:=%%GROUPS%%} @@ -31,19 +30,8 @@ user_cmd="%%PREFIX%%/bin/vnstat" start_precmd=vnstat_startprecmd -create_iface_database() -{ - local iface="$1" - local descr="$2" - su -m ${vnstat_user} -c "${user_cmd} --add --iface $iface" >/dev/null 2>&1 || - ! echo "$name: Failed to add database for the $descr interface $iface" || return 1 - echo "$name: Created the database for the $descr interface $iface" -} - vnstat_startprecmd() { - local dbdir iface - if [ ! -e ${pidfile%/*} ]; then install -d -o ${vnstat_user} -g ${vnstat_group} ${pidfile%/*}; fi @@ -53,18 +41,6 @@ vnstat_startprecmd() install -d -o ${vnstat_user} -g ${vnstat_group} ${dbdir}; fi - iface=$(grep "^Interface" ${vnstat_config} | head -1 | awk 'BEGIN{FS="\042"}{print $2}') - if [ -n "${iface}" -a ! -f ${dbdir}/${iface} ]; then - create_iface_database $iface "default" || return 1 - fi - if [ -n "${vnstat_additional_ifaces}" ]; then - for iface in ${vnstat_additional_ifaces}; do - if [ ! -f ${dbdir}/${iface} ]; then - create_iface_database $iface "additional" || return 1 - fi - done - fi - if [ ! -d "/var/run/vnstat" ]; then install -d -o ${vnstat_user} -g ${vnstat_group} /var/run/vnstat; fi -- cgit v1.2.3