Merge pull request #1881 from TDT-AG/pr/20180614-luci-mod-admin-full-fix-ssh-key-textarea
luci-mod-admin-full: fix empty SSH-Keys textarea issue
This commit is contained in:
commit
0d9a64b3b4
1 changed files with 5 additions and 4 deletions
|
@ -104,16 +104,17 @@ end
|
|||
keys = s2:option(TextValue, "_data", "")
|
||||
keys.wrap = "off"
|
||||
keys.rows = 3
|
||||
keys.rmempty = false
|
||||
|
||||
function keys.cfgvalue()
|
||||
return fs.readfile("/etc/dropbear/authorized_keys") or ""
|
||||
end
|
||||
|
||||
function keys.write(self, section, value)
|
||||
if value then
|
||||
fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"))
|
||||
end
|
||||
return fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"))
|
||||
end
|
||||
|
||||
function keys.remove(self, section, value)
|
||||
return fs.writefile("/etc/dropbear/authorized_keys", "")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue