Skip to content

Commit

Permalink
Remove init command
Browse files Browse the repository at this point in the history
  • Loading branch information
c-geek committed Nov 14, 2016
1 parent 00ffd2c commit 48a59b1
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions app/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,6 @@ program
});
})));

program
.command('init [host] [port]')
.description('Setup a node configuration and sync data with given node')
.action(subCommand(connect(bootstrapServer, true)));

program
.command('dump [what]')
.description('Diverse dumps of the inner data')
Expand Down Expand Up @@ -556,55 +551,6 @@ function makeDump(what, server, conf) {
});
}

function bootstrapServer(host, port, server, conf) {
async.series(getBootstrapOperations(host, port, server, conf), function (err) {
if (err) {
logger.error(err);
}
server.disconnect();
throw Error("Exiting");
});
}

function getBootstrapOperations(host, port, server, conf) {
var ops = [];
var wiz = wizard(server);
ops = ops.concat([
function (next) {
// Reset data
server.resetAll(next);
},
function (next) {
conf.upnp = !program.noupnp;
wiz.networkReconfiguration(conf, program.autoconf, program.noupnp, next);
},
function (next) {
// PublicKey
var keyChosen = true;
async.doWhilst(function (next) {
async.waterfall([
function (next) {
if (!conf.salt && !conf.passwd) {
wiz.keyReconfigure(conf, program.autoconf, next);
} else {
next();
}
}
], next);
}, function () {
return !keyChosen;
}, next);
},
function (next) {
return server.dal.saveConf(conf).then(_.partial(next, null)).catch(next);
}]);
ops.push(function (next) {
logger.info('Configuration saved.');
next();
});
return ops;
}

function commandLineConf(conf) {

conf = conf || {};
Expand Down

0 comments on commit 48a59b1

Please sign in to comment.