From b4787950bac6b92184653daf5c35dbe2a821748b Mon Sep 17 00:00:00 2001 From: varac Date: Sat, 19 Apr 2014 19:09:44 +0000 Subject: improved check if another instance of leap-platform-test is running --- leap-platform-test | 9 +++------ 1 file 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";; -- cgit v1.2.3