gluon-luci-admin: allow removing all SSH keys
This commit is contained in:
parent
74d29bcdc9
commit
e5999b3f44
@ -40,7 +40,7 @@ if fs.access("/etc/config/dropbear") then
|
|||||||
keys = s:option(TextValue, "_data", "")
|
keys = s:option(TextValue, "_data", "")
|
||||||
keys.wrap = "off"
|
keys.wrap = "off"
|
||||||
keys.rows = 5
|
keys.rows = 5
|
||||||
keys.rmempty = false
|
keys.rmempty = true
|
||||||
|
|
||||||
function keys.cfgvalue()
|
function keys.cfgvalue()
|
||||||
return fs.readfile("/etc/dropbear/authorized_keys") or ""
|
return fs.readfile("/etc/dropbear/authorized_keys") or ""
|
||||||
@ -51,6 +51,10 @@ if fs.access("/etc/config/dropbear") then
|
|||||||
fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"))
|
fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function keys.remove(self, section)
|
||||||
|
fs.remove("/etc/dropbear/authorized_keys")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
s = m:section(TypedSection, "_pass", nil,
|
s = m:section(TypedSection, "_pass", nil,
|
||||||
|
Loading…
Reference in New Issue
Block a user