From e5999b3f4422678ee4f3634b51a51aa1e5ec24ae Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 14 Jul 2014 18:56:49 +0200
Subject: [PATCH] gluon-luci-admin: allow removing all SSH keys

---
 .../files/usr/lib/lua/luci/model/cbi/admin/remote.lua       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua b/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua
index 4513d59c4..a3ce7f62c 100644
--- a/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua
+++ b/package/gluon-luci-admin/files/usr/lib/lua/luci/model/cbi/admin/remote.lua
@@ -40,7 +40,7 @@ if fs.access("/etc/config/dropbear") then
   keys = s:option(TextValue, "_data", "")
   keys.wrap    = "off"
   keys.rows    = 5
-  keys.rmempty = false
+  keys.rmempty = true
 
   function keys.cfgvalue()
     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"))
     end
   end
+
+  function keys.remove(self, section)
+    fs.remove("/etc/dropbear/authorized_keys")
+  end
 end
 
 s = m:section(TypedSection, "_pass", nil,
-- 
GitLab