diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-06-17 15:44:40 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-06-17 15:44:40 +0100 |
commit | 9ed736a0822c7e61a27fe585a22fba601bbb7791 (patch) | |
tree | aa926faa16e30642d2af6bd45c6374a2db0bb6a2 /bin | |
parent | d313a881e5185c1ddf03faa25582ea7e1345f1c6 (diff) | |
download | gitano-9ed736a0822c7e61a27fe585a22fba601bbb7791.tar.gz |
CONFIG: Move ssh authorized_keys generation into gitano.config for reuse
Diffstat (limited to 'bin')
-rw-r--r-- | bin/gitano-update-ssh | 28 |
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 |