mirror of
https://github.com/nasa/openmct.git
synced 2024-12-25 07:41:06 +00:00
38 lines
1.0 KiB
JavaScript
Executable File
38 lines
1.0 KiB
JavaScript
Executable File
#! /usr/bin/env node
|
|
|
|
var shell = require("shelljs/global");
|
|
var ps = require('psnode');
|
|
var S = require('string');
|
|
var sleep = require('sleep');
|
|
|
|
// A simple pid lookup
|
|
ps.list(function(err, results) {
|
|
|
|
results.forEach(function( process ){
|
|
//Killing Node
|
|
if((process.command.indexOf("node app.js")) != -1) {
|
|
console.log();
|
|
console.log( 'Killing Node: %s', process.command);
|
|
ps.kill(process.pid, function(err, stdout) {
|
|
if (err) {
|
|
throw new Error(err);
|
|
}
|
|
console.log(stdout);
|
|
});
|
|
}
|
|
sleep.usleep(10000);
|
|
if((process.command.indexOf("webdriver")) != -1) {
|
|
console.log();
|
|
console.log( 'Killing WebDriver: %s', process.command);
|
|
ps.kill(process.pid, function(err, stdout) {
|
|
if (err){
|
|
throw new Error(err);
|
|
}
|
|
console.log(stdout);
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
|