A cli tool to quickly create and manage nginx server blocks.
https://up.js.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
760 B
38 lines
760 B
'use strict';
|
|
|
|
const { EOL } = require('os');
|
|
|
|
const prompt = require('prompt');
|
|
const shell = require('shelljs');
|
|
|
|
const killAll = require('./killALL');
|
|
|
|
function killAllConfirm () {
|
|
// Start the prompt
|
|
|
|
prompt.start();
|
|
|
|
const property = {
|
|
name: 'yesno',
|
|
message: 'This will completely destroy all configs and reset nginx. ' +
|
|
'Are you sure?',
|
|
validator: /y[es]*|n[o]?/,
|
|
warning: 'Must respond yes or no',
|
|
default: 'no'
|
|
};
|
|
|
|
prompt.get(property, function (err, res) {
|
|
if(res.yesno == "no") {
|
|
console.log("Aborted!");
|
|
shell.exit(0);
|
|
}
|
|
else {
|
|
console.log("Deleting all servers...");
|
|
killAll();
|
|
console.log(EOL +
|
|
"Done. All configs have been destroyed. Hope you're happy.");
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = killAllConfirm;
|
|
|