diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-06-25 11:41:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 11:41:41 +0200 |
commit | 0d9a64b3b4220c99011fb576eaa2c97e0b91edb5 (patch) | |
tree | 831a36afb57a6440ddb9d7680c99e2e5f9ec1a7e /modules | |
parent | 6ff7f34ee8401bff554939608b8a56e566a7eec2 (diff) | |
parent | 0251603f0aa064109138d40d06aa892f49e7abc7 (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')
-rw-r--r-- | modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua | 9 |
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 493a735bd..6c1c1235c 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 |