luci-mod-network: migrate network config depending on netifd version
Checking netifd version is important for users of the most recent LuCI that didn't update netifd (e.g. OpenWrt package). Suggested-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
parent
b8acde7f48
commit
17af33ee48
2 changed files with 8 additions and 3 deletions
|
@ -294,6 +294,7 @@ return view.extend({
|
||||||
network.getDSLModemType(),
|
network.getDSLModemType(),
|
||||||
network.getDevices(),
|
network.getDevices(),
|
||||||
fs.lines('/etc/iproute2/rt_tables'),
|
fs.lines('/etc/iproute2/rt_tables'),
|
||||||
|
fs.read('/usr/lib/opkg/info/netifd.control'),
|
||||||
uci.changes()
|
uci.changes()
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
@ -354,8 +355,11 @@ return view.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function(data) {
|
render: function(data) {
|
||||||
if (this.interfaceWithIfnameSections().length ||
|
var netifdVersion = (data[3] || '').match(/Version: ([^\n]+)/);
|
||||||
this.deviceWithIfnameSections().length)
|
|
||||||
|
if (netifdVersion && netifdVersion[1] >= "2021-05-20" &&
|
||||||
|
(this.interfaceWithIfnameSections().length ||
|
||||||
|
this.deviceWithIfnameSections().length))
|
||||||
return this.renderMigration();
|
return this.renderMigration();
|
||||||
|
|
||||||
var dslModemType = data[0],
|
var dslModemType = data[0],
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"cgi-io": [ "exec" ],
|
"cgi-io": [ "exec" ],
|
||||||
"file": {
|
"file": {
|
||||||
"/etc/iproute2/rt_tables": [ "read" ],
|
"/etc/iproute2/rt_tables": [ "read" ],
|
||||||
"/usr/libexec/luci-peeraddr": [ "exec" ]
|
"/usr/libexec/luci-peeraddr": [ "exec" ],
|
||||||
|
"/usr/lib/opkg/info/netifd.control": [ "read" ]
|
||||||
},
|
},
|
||||||
"ubus": {
|
"ubus": {
|
||||||
"file": [ "exec" ],
|
"file": [ "exec" ],
|
||||||
|
|
Loading…
Reference in a new issue