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:
Jo-Philipp Wich 2018-06-25 11:41:41 +02:00 committed by GitHub
commit 0d9a64b3b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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