Fix saving of ipkg configuration file
This commit is contained in:
parent
1ebccd440f
commit
8565a58930
1 changed files with 4 additions and 5 deletions
|
@ -22,14 +22,13 @@ function t.cfgvalue()
|
||||||
return luci.fs.readfile(ipkgfile) or ""
|
return luci.fs.readfile(ipkgfile) or ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function t.write(self, section, data)
|
||||||
|
return luci.fs.writefile(ipkgfile, data)
|
||||||
|
end
|
||||||
|
|
||||||
f:append(Template("admin_system/ipkg"))
|
f:append(Template("admin_system/ipkg"))
|
||||||
|
|
||||||
function f.handle(self, state, data)
|
function f.handle(self, state, data)
|
||||||
if state == FORM_VALID then
|
|
||||||
if (luci.fs.readfile(ipkgfile) or "") ~= data.lines then
|
|
||||||
luci.fs.writefile(ipkgfile, data.lines)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue