mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
	
		
			391 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
	
		
			391 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| wan="$(uci -P/var/state get network.wan.ifname)"
 | |
| 
 | |
| if [ -n "$wan" ]; then
 | |
| 	uci -q batch <<-EOF >/dev/null
 | |
| 		del_list vnstat.@vnstat[-1].interface=$wan
 | |
| 		add_list vnstat.@vnstat[-1].interface=$wan
 | |
| 		commit vnstat
 | |
| 	EOF
 | |
| fi
 | |
| 
 | |
| uci -q batch <<-EOF >/dev/null
 | |
|     delete ucitrack.@vnstat[-1]
 | |
|     add ucitrack vnstat
 | |
|     set ucitrack.@vnstat[-1].init=vnstat
 | |
|     commit ucitrack
 | |
| EOF
 | |
| 
 | |
| exit 0
 |