From 172703d3b32daefaf28ecd6bde0aba9307664c9e Mon Sep 17 00:00:00 2001 From: bdaylik Date: Fri, 22 Mar 2024 15:15:35 +0300 Subject: [PATCH] Fix typo on omr-quota vnstat json does not contain a field named "months". The name of the field id "month". This causes this script to not manage quotas. --- omr-quota/files/bin/omr-quota | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omr-quota/files/bin/omr-quota b/omr-quota/files/bin/omr-quota index 6b3f11501..65c2a2693 100755 --- a/omr-quota/files/bin/omr-quota +++ b/omr-quota/files/bin/omr-quota @@ -11,8 +11,8 @@ shift # main loop while true; do 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"` + rx=`vnstat -i $OMR_QUOTA_REAL_INTERFACE --json | jsonfilter -q -e '@.interfaces[0].traffic.month[-1].rx' | tr -d "\n"` + tx=`vnstat -i $OMR_QUOTA_REAL_INTERFACE --json | jsonfilter -q -e '@.interfaces[0].traffic.month[-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