summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-full/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-06-25 11:41:41 +0200
committerGitHub <noreply@github.com>2018-06-25 11:41:41 +0200
commit0d9a64b3b4220c99011fb576eaa2c97e0b91edb5 (patch)
tree831a36afb57a6440ddb9d7680c99e2e5f9ec1a7e /modules/luci-mod-admin-full/luasrc
parent6ff7f34ee8401bff554939608b8a56e566a7eec2 (diff)
parent0251603f0aa064109138d40d06aa892f49e7abc7 (diff)
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
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc')
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua
index 493a735bde..6c1c1235c5 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua
@@ -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