mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +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() {
|
interface_max_metric() {
|
||||||
local config="$1"
|
local config="$1"
|
||||||
|
if [ "$1" != "omrvpn" ] && [ "$1" != "omr6in4" ]; then
|
||||||
config_get metric "$config" metric
|
config_get metric "$config" metric
|
||||||
if [ "$metric" = "$count" ]; then
|
if [ "$metric" = "$count" ]; then
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -56,6 +57,21 @@ interface_max_metric() {
|
||||||
if [ "$metric" -gt "$count" ]; then
|
if [ "$metric" -gt "$count" ]; then
|
||||||
count=$metric
|
count=$metric
|
||||||
fi
|
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() {
|
interface_multipath_settings() {
|
||||||
|
|
Loading…
Reference in a new issue