From owner-svn-ports-head@freebsd.org Thu Nov 22 14:12:51 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51C5A11499E2; Thu, 22 Nov 2018 14:12:51 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E43E5782E4; Thu, 22 Nov 2018 14:12:50 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AACE310F5A; Thu, 22 Nov 2018 14:12:50 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMECofR007818; Thu, 22 Nov 2018 14:12:50 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMEComO007817; Thu, 22 Nov 2018 14:12:50 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201811221412.wAMEComO007817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Thu, 22 Nov 2018 14:12:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r485599 - in head/net/vnstat: . files X-SVN-Group: ports-head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: in head/net/vnstat: . files X-SVN-Commit-Revision: 485599 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E43E5782E4 X-Spamd-Result: default: False [1.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.51)[0.514,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 14:12:51 -0000 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