mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update openmptcprouter script and config to use device setting instead of ifname
This commit is contained in:
parent
c5945ec683
commit
ea3a4840c4
7 changed files with 33 additions and 31 deletions
|
@ -1,24 +1,24 @@
|
|||
#!/bin/sh
|
||||
if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
||||
wanintf="$(uci -q get network.wan1.ifname)"
|
||||
wanintf="$(uci -q get network.wan1.device)"
|
||||
if [ "$(uci -q get vnstat.@vnstat[-1].interface | grep $wanintf)" = "" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete vnstat.@vnstat[-1]
|
||||
add vnstat vnstat
|
||||
set vnstat.@vnstat[-1].interface=$wanintf
|
||||
EOF
|
||||
wanintf="$(uci -q get network.wan2.ifname)"
|
||||
wanintf="$(uci -q get network.wan2.device)"
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
add_list vnstat.@vnstat[-1].interface=$wanintf
|
||||
EOF
|
||||
if [ "$(uci -q get network.wan3)" != "" ]; then
|
||||
wanintf="$(uci -q get network.wan3.ifname)"
|
||||
wanintf="$(uci -q get network.wan3.device)"
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
add_list vnstat.@vnstat[-1].interface=$wanintf
|
||||
EOF
|
||||
fi
|
||||
if [ "$(uci -q get network.wan4)" != "" ]; then
|
||||
wanintf="$(uci -q get network.wan4.ifname)"
|
||||
wanintf="$(uci -q get network.wan4.device)"
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
add_list vnstat.@vnstat[-1].interface=$wanintf
|
||||
EOF
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue