From a883c9914edd7739b384380706e629ab9bd43c07 Mon Sep 17 00:00:00 2001 From: ReaJason Date: Mon, 28 Apr 2025 00:47:34 +0800 Subject: [PATCH] test: use pgrep command --- integration-test/script/jboss_pid.sh | 2 +- integration-test/script/jetty_pid.sh | 2 +- integration-test/script/resin_pid.sh | 2 +- integration-test/script/tomcat_pid.sh | 2 +- integration-test/script/weblogic_pid.sh | 2 +- integration-test/script/websphere_pid.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration-test/script/jboss_pid.sh b/integration-test/script/jboss_pid.sh index 8c9870e0..81b85b68 100755 --- a/integration-test/script/jboss_pid.sh +++ b/integration-test/script/jboss_pid.sh @@ -1,2 +1,2 @@ #!/bin/bash -ps -ef | grep -E 'Main|jboss-modules.jar' | grep -v grep | awk '{print $2}' | tr -d '\n' \ No newline at end of file +pgrep -f 'Main|jboss-modules.jar' | tr -d '\n' \ No newline at end of file diff --git a/integration-test/script/jetty_pid.sh b/integration-test/script/jetty_pid.sh index 92795ef5..acbee4b5 100755 --- a/integration-test/script/jetty_pid.sh +++ b/integration-test/script/jetty_pid.sh @@ -1,2 +1,2 @@ #!/bin/bash -ps -ef | grep "jetty.home" | grep -v grep | awk '{print $2}' | tr -d '\n' \ No newline at end of file +pgrep -f "jetty.home" | tr -d '\n' \ No newline at end of file diff --git a/integration-test/script/resin_pid.sh b/integration-test/script/resin_pid.sh index 812d40a2..14f63bf2 100755 --- a/integration-test/script/resin_pid.sh +++ b/integration-test/script/resin_pid.sh @@ -1,2 +1,2 @@ #!/bin/bash -ps -ef | grep Resin | grep -v grep | awk '{print $2}' | tr -d '\n' \ No newline at end of file +pgrep -f Resin | tr -d '\n' \ No newline at end of file diff --git a/integration-test/script/tomcat_pid.sh b/integration-test/script/tomcat_pid.sh index 0af57ef9..96fef2c3 100755 --- a/integration-test/script/tomcat_pid.sh +++ b/integration-test/script/tomcat_pid.sh @@ -1,2 +1,2 @@ #!/bin/bash -ps -ef | grep Bootstrap | grep -v grep | awk '{print $2}' | tr -d '\n' \ No newline at end of file +pgrep -f Bootstrap | tr -d '\n' \ No newline at end of file diff --git a/integration-test/script/weblogic_pid.sh b/integration-test/script/weblogic_pid.sh index f690f8a4..75947e5f 100755 --- a/integration-test/script/weblogic_pid.sh +++ b/integration-test/script/weblogic_pid.sh @@ -2,7 +2,7 @@ pid="" if command -v ps &> /dev/null; then - pid=$(ps -ef | grep weblogic | grep -v grep | awk '{print $2}') + pid=$(pgrep -f weblogic) fi if [ -z "$pid" ]; then diff --git a/integration-test/script/websphere_pid.sh b/integration-test/script/websphere_pid.sh index 44148d59..d011fc34 100755 --- a/integration-test/script/websphere_pid.sh +++ b/integration-test/script/websphere_pid.sh @@ -1,2 +1,2 @@ #!/bin/bash -ps -ef | grep WSLauncher | grep -v grep | awk '{print $2}' | tr -d '\n' \ No newline at end of file +pgrep -f WSLauncher | tr -d '\n' \ No newline at end of file