]]--
local keyfile = "/etc/dropbear/authorized_keys"
-f = SimpleForm("sshkeys", translate("a_s_sshkeys"), translate("a_s_sshkeys1"))
+f = SimpleForm("sshkeys", translate("<abbr title=\"Secure Shell\">SSH</abbr>-Keys"), translate("Here you can paste public <abbr title=\"Secure Shell\">SSH</abbr>-Keys (one per line) for <abbr title=\"Secure Shell\">SSH</abbr> public-key authentication."))
t = f:field(TextValue, "keys")
+t.rmempty = true
t.rows = 10
function t.cfgvalue()
- return luci.fs.readfile(keyfile) or ""
+ return nixio.fs.readfile(keyfile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
- if (luci.fs.readfile(keyfile) or "") ~= data.keys then
- luci.fs.writefile(keyfile, data.keys)
+ if data.keys then
+ nixio.fs.writefile(keyfile, data.keys:gsub("\r\n", "\n"))
end
end
return true
end
-return f
\ No newline at end of file
+return f