local uci = require "luci.model.uci".cursor()
local util = require "luci.util"
-local fs = require "nixio"
+local nx = require "nixio"
function index()
if not nixio.fs.access("/etc/config/lxc") then
function lxc_create(lxc_name, lxc_template)
luci.http.prepare_content("text/plain")
- local check = lxc_get_config_path()
- if not check then
+ local path = lxc_get_config_path()
+ if not path then
return
end
ssl_status
}
}), src_err)
+
+ while (nx.fs.access(path .. lxc_name .. "/partial")) do
+ nx.nanosleep(1)
+ end
end
function lxc_action(lxc_action, lxc_name)
local ret = content:match('^%s*lxc.lxcpath%s*=%s*([^%s]*)')
if ret then
- if nixio.fs.access(ret) then
+ if nx.fs.access(ret) then
local min_space = tonumber(uci:get("lxc", "lxc", "min_space")) or 100000
local free_space = tonumber(util.exec("df " ..ret.. " | awk '{if(NR==2)print $4}'"))
if free_space and free_space >= min_space then
end
function lxc_get_arch_target()
- local target = fs.uname().machine
+ local target = nx.uname().machine
local target_map = {
armv5 = "armel",
armv6 = "armel",
-%>
<%-
-local fs = require "nixio"
-local target = fs.uname().machine
+local nx = require "nixio"
+local target = nx.uname().machine
-%>
<fieldset class="cbi-section">
var div3 = document.createElement("div");
div3.className = "td";
div3.style.width = "50%";
- div3.innerHTML = actions
+ div3.innerHTML = actions;
document.getElementById("t_lxc_list").appendChild(div0);
div0.appendChild(div1);
}
else if (action == "destroy")
{
- var div = self.parentNode.parentNode
- var img = div.querySelector('img')
+ var div = self.parentNode.parentNode;
+ var img = div.querySelector('img');
if (img.getAttribute('src') != window.img["red"])
{