From 1fb401270f3c4d8716e6ebca2289d9008066ab8c Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 28 Mar 2017 21:18:34 +0200 Subject: [PATCH] iguana pkill osx --- main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index b69245e..6789d27 100644 --- a/main.js +++ b/main.js @@ -38,7 +38,14 @@ var shepherd = require('./routes/shepherd'), appConfig = shepherd.loadLocalConfig(); // load app config if (appConfig.killIguanaOnStart) { - exec('ps -p $(pidof iguana)', function(error, stdout, stderr) { + var iguanaGrep; + if (os.platform() === 'darwin') { + iguanaGrep = "ps -p $(ps -A | grep -m1 iguana | awk '{print $1}')"; + } + if (os.platform() === 'linux') { + iguanaGrep = 'ps -p $(pidof iguana)'; + } + exec(iguanaGrep, function(error, stdout, stderr) { if (stdout.indexOf('iguana') > -1) { console.log('found another iguana process(es)'); exec('pkill iguana', function(error, stdout, stderr) {