mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Better max metric calculation
This commit is contained in:
parent
426eff6569
commit
0a6c82e855
1 changed files with 23 additions and 7 deletions
|
@ -48,6 +48,7 @@ interface_macaddr_count() {
|
|||
|
||||
interface_max_metric() {
|
||||
local config="$1"
|
||||
if [ "$1" != "omrvpn" ] && [ "$1" != "omr6in4" ]; then
|
||||
config_get metric "$config" metric
|
||||
if [ "$metric" = "$count" ]; then
|
||||
count=$((count+1))
|
||||
|
@ -56,6 +57,21 @@ interface_max_metric() {
|
|||
if [ "$metric" -gt "$count" ]; then
|
||||
count=$metric
|
||||
fi
|
||||
elif [ "$1" = "omrvpn" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set network.${config}.metric=1200
|
||||
commit network
|
||||
set openmptcprouter.${config}.metric=1200
|
||||
commit openmptcprouter
|
||||
EOF
|
||||
elif [ "$1" = "omr6in4" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set network.${config}.metric=1201
|
||||
commit network
|
||||
set openmptcprouter.${config}.metric=1201
|
||||
commit openmptcprouter
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
interface_multipath_settings() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue