Mageia Bugzilla – Attachment 12454 Details for
Bug 15691
Vnstat is not enabled when accounting is activated in draknetcenter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Script to update nics in /etc/vnstat.conf
vnstatUpdatesNics (text/plain), 634 bytes, created by
Dave Hodgins
on 2021-03-12 07:09:23 CET
(
hide
)
Description:
Script to update nics in /etc/vnstat.conf
Filename:
MIME Type:
Creator:
Dave Hodgins
Created:
2021-03-12 07:09:23 CET
Size:
634 bytes
patch
obsolete
>#!/bin/bash ># Change Interface names in /etc/vnstat.conf to reflect what is detected in system ># By David W. Hodgins davidwhodgins@mageia.org 2021-03-12 >NicDevNames="" >for NicDevName in /sys/class/net/* ; do > if [ "/sys/class/net/lo" != "${NicDevName}" ] ; then > NicDev="${NicDevName##*/}" # strip last slash and everything before it. > NicDevNames="${NicDevNames}${NicDev}+" > fi >done >NicDevNames="${NicDevNames%+}" # Strip trailing plus sign >#sed -i "0,/^Interface/s/\(^I.*\)/Interface \"${NicDevNames}\"/" /etc/vnstat.conf >sed -i "0,/^Interface/s/\(^I.*\)/Interface \"${NicDevNames}\"/" /etc/vnstat.conf >exit 0
#!/bin/bash # Change Interface names in /etc/vnstat.conf to reflect what is detected in system # By David W. Hodgins davidwhodgins@mageia.org 2021-03-12 NicDevNames="" for NicDevName in /sys/class/net/* ; do if [ "/sys/class/net/lo" != "${NicDevName}" ] ; then NicDev="${NicDevName##*/}" # strip last slash and everything before it. NicDevNames="${NicDevNames}${NicDev}+" fi done NicDevNames="${NicDevNames%+}" # Strip trailing plus sign #sed -i "0,/^Interface/s/\(^I.*\)/Interface \"${NicDevNames}\"/" /etc/vnstat.conf sed -i "0,/^Interface/s/\(^I.*\)/Interface \"${NicDevNames}\"/" /etc/vnstat.conf exit 0
View Attachment As Raw
Actions:
View
Attachments on
bug 15691
:
6258
|
6259
|
6260
|
6261
|
6262
|
6264
|
6267
| 12454