X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fniu%2Fluasrc%2Fmodel%2Fcbi%2Fniu%2Fnetwork%2Flan.lua;fp=modules%2Fniu%2Fluasrc%2Fmodel%2Fcbi%2Fniu%2Fnetwork%2Flan.lua;h=0000000000000000000000000000000000000000;hp=ee70dd2cc7da703f43878bec2bef10fa7b38cbaf;hb=91b97bc9f625d09431dc1c753209a037d7c42fbc;hpb=2d05a6135a0d29a82148f9bfc215b2de5b609dd5 diff --git a/modules/niu/luasrc/model/cbi/niu/network/lan.lua b/modules/niu/luasrc/model/cbi/niu/network/lan.lua deleted file mode 100644 index ee70dd2cc..000000000 --- a/modules/niu/luasrc/model/cbi/niu/network/lan.lua +++ /dev/null @@ -1,44 +0,0 @@ -local uci = require "luci.model.uci" -local cursor = uci.cursor() -local d = Delegator() -d.allow_finish = true -d.allow_back = true -d.allow_cancel = true - -d:add("lan1", "niu/network/lan1") - -function d.on_cancel() - cursor:revert("network") - cursor:revert("dhcp") -end - -function d.on_done() - if uci.inst_state:get("network", "lan", "ipaddr") ~= cursor:get("network", "lan", "ipaddr") then - local cs = uci.cursor_state() - cs:set("network", "lan", "_ipchanged", "1") - cs:save("network") - end - - if cursor:get("network", "lan", "proto") == "dhcp" then - local emergv4 = cursor:get("network", "lan", "_emergv4") - if emergv4 then - if cursor:get("network", "lan_ea") then - cursor:set("network", "lan_ea", "ipaddr", emergv4) - else - cursor:section("network", "alias", "lan_ea", { - ipaddr = emergv4, - netmask = "255.255.255.0", - network = "lan" - }) - end - else - cursor:delete("network", "lan_ea") - end - end - - cursor:set("network", "lan", "type", "bridge") - cursor:commit("network") - cursor:commit("dhcp") -end - -return d \ No newline at end of file