mirror of https://github.com/apache/jclouds.git
avoid finding yourself when looking for a process match
This commit is contained in:
parent
0e8385aa83
commit
712d50dea8
|
@ -5,7 +5,7 @@ function findPid {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
local PATTERN="$1"; shift
|
local PATTERN="$1"; shift
|
||||||
local _FOUND=`ps auxwww|grep "$PATTERN"|grep -v " $0"|grep -v grep|awk '{print $2}'`
|
local _FOUND=`ps auxwww|grep "$PATTERN"|grep -v " $0"|grep -v grep|grep -v $$|awk '{print $2}'`
|
||||||
[ -n "$_FOUND" ] && {
|
[ -n "$_FOUND" ] && {
|
||||||
export FOUND_PID=$_FOUND
|
export FOUND_PID=$_FOUND
|
||||||
return 0
|
return 0
|
||||||
|
|
|
@ -14,7 +14,7 @@ function findPid {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
local PATTERN="$1"; shift
|
local PATTERN="$1"; shift
|
||||||
local _FOUND=`ps auxwww|grep "$PATTERN"|grep -v " $0"|grep -v grep|awk '{print $2}'`
|
local _FOUND=`ps auxwww|grep "$PATTERN"|grep -v " $0"|grep -v grep|grep -v $$|awk '{print $2}'`
|
||||||
[ -n "$_FOUND" ] && {
|
[ -n "$_FOUND" ] && {
|
||||||
export FOUND_PID=$_FOUND
|
export FOUND_PID=$_FOUND
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in New Issue