Commit 4faae3ab authored by Ivan Tyagov's avatar Ivan Tyagov

Avoid matchin PIDs like this case 1234 and 41234 when smaller PID is a

subset of bigger one.
parent 8272cdfe
......@@ -11,7 +11,7 @@ for pid in $ZOPE_PIDS;
do
# remove any trailing character in case PID is less than 5 digits
pid="$(echo ${pid} | sed 's/,//')"
ip_port="$(netstat -lpn --inet --inet6 | grep $pid/ |awk '{print substr($0, 21, 17);}')";
ip_port="$(netstat -lpn --inet --inet6 | grep " $pid"/ |awk '{print substr($0, 21, 17);}')";
#echo $pid, $ip_port, $port
# socat
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment