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.
32 lines
694 B
32 lines
694 B
7 years ago
|
const prompt = require('prompt');
|
||
|
const shell = require('shelljs');
|
||
|
|
||
|
const killAll = require('./killALL');
|
||
|
|
||
|
function killAllConfirm () {
|
||
|
// Start the prompt
|
||
|
|
||
|
prompt.start();
|
||
|
|
||
|
var 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("\nDone. All configs have been destroyed. Hope you're happy.");
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
module.exports = killAllConfirm;
|