From 7496b3d3c1cdc4f9353754a5449b0b91d0d13d82 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 3 Oct 2014 00:47:48 +0200
Subject: [PATCH] gluon-luci-admin: fix SSH keys being removed when a password
 is set

---
 .../files/usr/lib/lua/luci/model/cbi/admin/remote.lua         | 4 +++-
 1 file changed, 3 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 8617c439f..dfba5e66b 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
@@ -51,7 +51,9 @@ if fs.access("/etc/config/dropbear") then
   end
 
   function keys.remove(self, section)
-    fs.remove("/etc/dropbear/authorized_keys")
+    if keys:formvalue("_keys") then
+      fs.remove("/etc/dropbear/authorized_keys")
+    end
   end
 end
 
-- 
GitLab