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

add quiet options when jsonfilter is used

This commit is contained in:
Ycarus 2018-06-18 23:27:34 +02:00
parent eb9658bcb1
commit f6efdc51c9
6 changed files with 13 additions and 13 deletions

View file

@ -10,8 +10,8 @@ shift
# main loop
while true; do
rx=`vnstat -i $OMR_QUOTA_INTERFACE --json | jsonfilter -e '@.interfaces[0].traffic.months[-1].rx' | tr -d "\n"`
tx=`vnstat -i $OMR_QUOTA_INTERFACE --json | jsonfilter -e '@.interfaces[0].traffic.months[-1].tx' | tr -d "\n"`
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"`
tt=$((rx + tx))
[ -n "$OMR_QUOTA_RX" ] && [ "$OMR_QUOTA_RX" -gt 0 ] && [ -n "$rx" ] && [ "$OMR_QUOTA_RX" -ge "$rx" ] && ifdown $OMR_QUOTA_INTERFACE \
|| \