svn commit: r485599 - in head/net/vnstat: . files
Mark Felder
feld at FreeBSD.org
Thu Nov 22 14:12:51 UTC 2018
Author: feld
Date: Thu Nov 22 14:12:49 2018
New Revision: 485599
URL: https://svnweb.freebsd.org/changeset/ports/485599
Log:
net/vnstat: Update rc script to correctly import old data into new database format
Modified:
head/net/vnstat/Makefile
head/net/vnstat/files/vnstat.in
Modified: head/net/vnstat/Makefile
==============================================================================
--- head/net/vnstat/Makefile Thu Nov 22 12:48:21 2018 (r485598)
+++ head/net/vnstat/Makefile Thu Nov 22 14:12:49 2018 (r485599)
@@ -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/
Modified: head/net/vnstat/files/vnstat.in
==============================================================================
--- head/net/vnstat/files/vnstat.in Thu Nov 22 12:48:21 2018 (r485598)
+++ head/net/vnstat/files/vnstat.in Thu Nov 22 14:12:49 2018 (r485599)
@@ -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
@@ -51,18 +39,6 @@ vnstat_startprecmd()
dbdir=$(grep "^DatabaseDir" ${vnstat_config} | awk 'BEGIN{FS="\042"}{print $2}')
if [ ! -d ${dbdir} ]; then
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
More information about the svn-ports-all
mailing list