Renamed reworked UCI API to uci2 to allow a peaceful coexistence with the old one
[project/luci.git] / libs / httpd / host / runluci
index d31b3f7..f150cae 100755 (executable)
@@ -17,10 +17,10 @@ vhost   = luci.httpd.server.VHost()
 
 server:set_default_vhost(vhost)
 
-if pcall(require, "uci") and pcall(require, "luci.model.uci") then
-       luci.model.uci.confdir_default = SYSROOT .. luci.model.uci.confdir_default
-       luci.model.uci.savedir_state   = SYSROOT .. luci.model.uci.savedir_state
-       luci.model.uci.set_confdir(luci.model.uci.confdir_default)
+if pcall(require, "uci2") and pcall(require, "luci.model.uci") then
+       luci.model.uci.cursor = function(config, save)
+               return uci2.cursor(config or SYSROOT .. "/etc/config", save or SYSROOT .. "/tmp/.uci")
+       end
 end
 
 require("luci.sys")