mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	omr-quota does not work as expected due to a typo in checking json field "months" (#306)
* 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. * agree to contribution terms
This commit is contained in:
		
							parent
							
								
									a2af208487
								
							
						
					
					
						commit
						a5ac3e4a01
					
				
					 2 changed files with 11 additions and 2 deletions
				
			
		
							
								
								
									
										9
									
								
								contributors/bdaylik.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								contributors/bdaylik.md
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
2024-03-22
 | 
			
		||||
 | 
			
		||||
I hereby agree to the terms of the "OpenMPTCProuter Individual Contributor License Agreement", with MD5 checksum bc827a07eb93611d793ddb7c75083c00.
 | 
			
		||||
 | 
			
		||||
I furthermore declare that I am authorized and able to make this agreement and sign this declaration.
 | 
			
		||||
 | 
			
		||||
Signed,
 | 
			
		||||
 | 
			
		||||
Baris Daylik https://github.com/bdaylik
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue