diff --git a/emhttp/plugins/dynamix/Eth0.page b/emhttp/plugins/dynamix/Eth0.page index a88463eb5..315974bbc 100644 --- a/emhttp/plugins/dynamix/Eth0.page +++ b/emhttp/plugins/dynamix/Eth0.page @@ -52,15 +52,15 @@ function index($key) { return filter_var($key,FILTER_SANITIZE_NUMBER_INT); } -function metric($eth, $prot) { +function metric($eth, $prot, $index) { $system = '/sys/class/net'; $bridge = str_replace('eth','br',$eth); $bond = str_replace('eth','bond',$eth); $port = file_exists("$system/$bridge") ? $bridge : (file_exists("$system/$bond") ? $bond : $eth); - $metric = exec("ip -$prot route show default dev $port | grep -Pom1 ' metric \K\d+'"); - if ($metric) return $metric; - exec("ip -$prot route show default | grep -Po ' metric \K\d+'",$metrics); - return max($metrics) + 1; + $metric = exec("ip -$prot route show default dev $port 2>/dev/null | grep -Pom1 ' metric \K\d+'"); + if ($metric) return $metric + $index; + exec("ip -$prot route show default 2>/dev/null | grep -Po ' metric \K\d+'",$metrics); + return max($metrics) + $index + 1; } // remove non-existing ethernet ports @@ -717,7 +717,7 @@ _(IPv4 address)_: _(IPv4 default gateway)_: : " class="narrow" pattern="" title="_(IPv4 address A.B.C.D)_"> - " class="slim"> ** + " class="slim"> ** :eth_ipv4_default_gateway_help: @@ -734,13 +734,13 @@ _(IPv6 address assignment)_:
_(IPv6 address)_: -: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> +: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> :eth_ipv6_address_help: _(IPv6 default gateway)_: : " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_"> - " class="slim"> ** + " class="slim"> ** :eth_ipv6_default_gateway_help: @@ -817,7 +817,7 @@ _(IPv4 address)_:
_(IPv4 default gateway)_: : " class="narrow" pattern="" title="_(IPv4 address A.B.C.D)_"> - " class="slim"> ** + ',4,$i)?>" class="slim"> ** :eth_ipv4_default_gateway_help: @@ -839,14 +839,14 @@ _(IPv6 address assignment)_:
_(IPv6 address)_: -: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> +: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> :eth_ipv6_address_help:
_(IPv6 default gateway)_: : " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_"> - " class="slim"> ** + ',6,$i)?>" class="slim"> ** :eth_ipv6_default_gateway_help: @@ -897,18 +897,18 @@ _(IPv4 address assignment)_: - > +
_(IPv4 address)_: -: " class="narrow" pattern="" title="=_(IPv4 address A.B.C.D)_">// -
+
_(IPv4 default gateway)_: -: " class="narrow" pattern="" title="_(IPv4 address A.B.C.D)_"> - " class="slim"> ** +: + **
@@ -920,16 +920,16 @@ _(IPv6 address assignment)_: - > +
_(IPv6 address)_: -: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> +: / -
+
_(IPv6 default gateway)_: -: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_"> - " class="slim"> ** +: + **
diff --git a/emhttp/plugins/dynamix/EthX.page b/emhttp/plugins/dynamix/EthX.page index a769fc035..da03584a7 100644 --- a/emhttp/plugins/dynamix/EthX.page +++ b/emhttp/plugins/dynamix/EthX.page @@ -185,7 +185,7 @@ _(IPv4 address)_:
_(IPv4 default gateway)_: : " class="narrow" pattern="" title="_(IPv4 address A.B.C.D)_"> - " class="slim"> ** + " class="slim"> ** :eth_ipv4_default_gateway_help: @@ -205,14 +205,14 @@ _(IPv6 address assignment)_:
_(IPv6 address)_: -: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> +: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> :eth_ipv6_address_help:
_(IPv6 default gateway)_: : " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_"> - " class="slim"> ** + " class="slim"> ** :eth_ipv6_default_gateway_help: @@ -291,7 +291,7 @@ _(IPv4 address)_:
_(IPv4 default gateway)_: : " class="narrow" pattern="" title="_(IPv4 address A.B.C.D)_"> - " class="slim"> ** + ',4,$i)?>" class="slim"> ** :eth_ipv4_default_gateway_help: @@ -311,14 +311,14 @@ _(IPv6 address assignment)_:
_(IPv6 address)_: -: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> +: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> :eth_ipv6_address_help:
_(IPv6 default gateway)_: : " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_"> - " class="slim"> ** + ',6,$i)?>" class="slim"> ** :eth_ipv6_default_gateway_help: @@ -374,14 +374,14 @@ _(IPv4 address assignment)_:
_(IPv4 address)_: -: " class="narrow" pattern="" title="_(IPv4 address A.B.C.D)_">//
_(IPv4 default gateway)_: -: " class="narrow" pattern="" title="_(IPv4 address A.B.C.D)_"> - " class="slim"> ** +: + **
@@ -397,12 +397,12 @@ _(IPv6 address assignment)_:
_(IPv6 address)_: -: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_">/" class="slim"> +: /
_(IPv6 default gateway)_: -: " pattern="" title="_(IPv6 address nnnn:xxxx::yyyy)_"> - " class="slim"> ** +: + **