X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fadmin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_system%2Fbackupfiles.lua;fp=modules%2Fadmin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_system%2Fbackupfiles.lua;h=0000000000000000000000000000000000000000;hp=a063ec0aa4b65b961182119dbbe3343737fd6d8b;hb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92;hpb=9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 diff --git a/modules/admin-full/luasrc/model/cbi/admin_system/backupfiles.lua b/modules/admin-full/luasrc/model/cbi/admin_system/backupfiles.lua deleted file mode 100644 index a063ec0aa4..0000000000 --- a/modules/admin-full/luasrc/model/cbi/admin_system/backupfiles.lua +++ /dev/null @@ -1,92 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth -Copyright 2011 Jo-Philipp Wich - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]]-- - - -if luci.http.formvalue("cbid.luci.1._list") then - luci.http.redirect(luci.dispatcher.build_url("admin/system/flashops/backupfiles") .. "?display=list") -elseif luci.http.formvalue("cbid.luci.1._edit") then - luci.http.redirect(luci.dispatcher.build_url("admin/system/flashops/backupfiles") .. "?display=edit") - return -end - -m = SimpleForm("luci", translate("Backup file list")) -m:append(Template("admin_system/backupfiles")) - -if luci.http.formvalue("display") ~= "list" then - f = m:section(SimpleSection, nil, translate("This is a list of shell glob patterns for matching files and directories to include during sysupgrade. Modified files in /etc/config/ and certain other configurations are automatically preserved.")) - - l = f:option(Button, "_list", translate("Show current backup file list")) - l.inputtitle = translate("Open list...") - l.inputstyle = "apply" - - c = f:option(TextValue, "_custom") - c.rmempty = false - c.cols = 70 - c.rows = 30 - - c.cfgvalue = function(self, section) - return nixio.fs.readfile("/etc/sysupgrade.conf") - end - - c.write = function(self, section, value) - value = value:gsub("\r\n?", "\n") - return nixio.fs.writefile("/etc/sysupgrade.conf", value) - end -else - m.submit = false - m.reset = false - - f = m:section(SimpleSection, nil, translate("Below is the determined list of files to backup. It consists of changed configuration files marked by opkg, essential base files and the user defined backup patterns.")) - - l = f:option(Button, "_edit", translate("Back to configuration")) - l.inputtitle = translate("Close list...") - l.inputstyle = "link" - - - d = f:option(DummyValue, "_detected") - d.rawhtml = true - d.cfgvalue = function(s) - local list = io.popen( - "( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' /etc/sysupgrade.conf " .. - "/lib/upgrade/keep.d/* 2>/dev/null) -type f 2>/dev/null; " .. - "opkg list-changed-conffiles ) | sort -u" - ) - - if list then - local files = { "" - - return table.concat(files, "") - end - - return "" .. translate("No files found") .. "" - end - -end - -return m