diff options
author | varac <varacanero@zeromail.org> | 2014-04-19 19:09:44 +0000 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2014-04-19 19:09:44 +0000 |
commit | b4787950bac6b92184653daf5c35dbe2a821748b (patch) | |
tree | efa9f83e5f4dd78379005738e2186281932380ca | |
parent | 58f6b7137151395293a4fde518fdf5389b3a05d3 (diff) |
improved check if another instance of leap-platform-test is running
-rwxr-xr-x | leap-platform-test | 9 |
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";; |