summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-04-19 19:09:44 +0000
committervarac <varacanero@zeromail.org>2014-04-19 19:09:44 +0000
commitb4787950bac6b92184653daf5c35dbe2a821748b (patch)
treeefa9f83e5f4dd78379005738e2186281932380ca
parent58f6b7137151395293a4fde518fdf5389b3a05d3 (diff)
improved check if another instance of leap-platform-test is running
-rwxr-xr-xleap-platform-test9
1 files changed, 3 insertions, 6 deletions
diff --git a/leap-platform-test b/leap-platform-test
index ff2b582..d93badb 100755
--- a/leap-platform-test
+++ b/leap-platform-test
@@ -348,15 +348,12 @@ else
nodes=$nodelist
fi
-# check if another process is already running with same config file
-procs=`pgrep -fl 'leap-platform-test.*-c.*/etc/leap/rewire_develop.cfg'|grep -v -i screen|wc -l`
-
-if [ $procs -gt 2 ]; then
- echo "Other process(es) found running for config $config - exiting."
+if [[ "`pidof -x $(basename $0) -o %PPID`" ]]
+then
+ echo "Other process(es) found running for $(basename $0) - exiting."
exit 1
fi
-
case $cmd in
add_nodes) add_nodes "$nodes";;
bootstrap) bootstrap_nodes "$nodes";;