moved fs.chmod into openssl rsa callback function

This commit is contained in:
Vincenzo D'Amore 2015-10-01 13:07:40 +02:00
parent e59bcad460
commit 768644c314

View File

@ -108,10 +108,10 @@ var create_ssh_key = function (prefix) {
openssl.exec('req', opts, function (err, buffer) {
if (err) console.log(clr.red(err));
openssl.exec('rsa', { in: opts.keyout, out: opts.keyout }, function (err, buffer) {
if (err) console.log(clr.red(err));
});
fs.chmod(opts.keyout, '0600', function (err) {
if (err) console.log(clr.red(err));
fs.chmod(opts.keyout, '0600', function (err) {
if (err) console.log(clr.red(err));
});
});
});
return {