1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add all interfaces in vnstat

This commit is contained in:
Ycarus 2019-02-06 20:29:07 +01:00
parent 90e2ddf33f
commit 7beebee9ae

View file

@ -20,14 +20,17 @@ _launch_quota() {
_validate_section "interface" "$1"
interface=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
[ -z "$txquota" ] && [ -z "$rxquota" ] && [ -z "$ttquota" ] && return
[ "$enabled" = "0" ] && return
[ -z "$interface" ] && return
[ "$(uci get vnstat.@vnstat[-1].interface | grep $interface)" = "" ] && {
uci -q batch <<-EOF
add_list vnstat.@vnstat[-1].interface=$interface
EOF
}
[ -z "$txquota" ] && [ -z "$rxquota" ] && [ -z "$ttquota" ] && return
[ "$enabled" = "0" ] && return
procd_open_instance
procd_set_param command /bin/omr-quota "$interface"
procd_append_param env "OMR_QUOTA_TX=$txquota"