mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 11:31:51 +00:00
Should fix omr-quota
This commit is contained in:
parent
a42b89fce1
commit
18d100f508
1 changed files with 3 additions and 2 deletions
|
@ -10,8 +10,9 @@ shift
|
|||
|
||||
# main loop
|
||||
while true; do
|
||||
rx=`vnstat -i $OMR_QUOTA_INTERFACE --json | jsonfilter -q -e '@.interfaces[0].traffic.months[-1].rx' | tr -d "\n"`
|
||||
tx=`vnstat -i $OMR_QUOTA_INTERFACE --json | jsonfilter -q -e '@.interfaces[0].traffic.months[-1].tx' | tr -d "\n"`
|
||||
OMR_QUOTA_REAL_INTERFACE="$(ifstatus $OMR_QUOTA_INTERFACE | jsonfilter -e '@.l3_device')"
|
||||
rx=`vnstat -i $OMR_QUOTA_REAL_INTERFACE --json | jsonfilter -q -e '@.interfaces[0].traffic.months[-1].rx' | tr -d "\n"`
|
||||
tx=`vnstat -i $OMR_QUOTA_REAL_INTERFACE --json | jsonfilter -q -e '@.interfaces[0].traffic.months[-1].tx' | tr -d "\n"`
|
||||
tt=$((rx + tx))
|
||||
if [ -n "$OMR_QUOTA_RX" ] && [ "$OMR_QUOTA_RX" -gt 0 ] && [ -n "$rx" ] && [ "$OMR_QUOTA_RX" -le "$rx" ]; then
|
||||
if [ "$(ifstatus $OMR_QUOTA_INTERFACE | jsonfilter -e '@.up')" = "true" ]; then
|
||||
|
|
Loading…
Reference in a new issue