summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-06-17 15:44:40 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-06-17 15:44:40 +0100
commit9ed736a0822c7e61a27fe585a22fba601bbb7791 (patch)
treeaa926faa16e30642d2af6bd45c6374a2db0bb6a2 /bin
parentd313a881e5185c1ddf03faa25582ea7e1345f1c6 (diff)
downloadgitano-9ed736a0822c7e61a27fe585a22fba601bbb7791.tar.gz
CONFIG: Move ssh authorized_keys generation into gitano.config for reuse
Diffstat (limited to 'bin')
-rw-r--r--bin/gitano-update-ssh28
1 files changed, 1 insertions, 27 deletions
diff --git a/bin/gitano-update-ssh b/bin/gitano-update-ssh
index 5c928cf..ed96bab 100644
--- a/bin/gitano-update-ssh
+++ b/bin/gitano-update-ssh
@@ -40,32 +40,6 @@ if not config then
gitano.log.fatal("Cannot continue")
end
-local ssh_config = gitano.config.genssh(config)
-
-local home = luxio.getenv "HOME"
-
-if not home then
- gitano.log.fatal("Unable to find HOME")
-end
-
-local ssh_path = home .. "/.ssh/authorized_keys"
-
-local create_path = ssh_path .. ".new"
-
-local cfh, err = sio.open(create_path, "cew")
-
-if not cfh or cfh == -1 then
- gitano.log.fatal("Unable to create " .. create_path)
-end
-
-cfh:write(ssh_config)
-cfh:close()
-
-local ret, errno = luxio.rename(create_path, ssh_path)
-if ret ~= 0 then
- gitano.log.fatal("Unable to overwrite " .. ssh_path)
-end
-
-gitano.log.chat "SSH authorised key file updated"
+gitano.config.writessh(config)
return 0