← Back to team overview

canonical-hw-cert team mailing list archive

[Merge] ~kevinyeh/hwcert-jenkins-jobs:fix-running-script-sru into hwcert-jenkins-jobs:master

 

Kevin Yeh has proposed merging ~kevinyeh/hwcert-jenkins-jobs:fix-running-script-sru into hwcert-jenkins-jobs:master.

Commit message:
Fix: add -w to avoid searching other processes that include apt or dpkg string.

Requested reviews:
  hwcert-jenkins (hwcert-jenkins)

For more details, see:
https://code.launchpad.net/~kevinyeh/hwcert-jenkins-jobs/+git/hwcert-jenkins-jobs/+merge/435341
-- 
Your team hwcert-jenkins is requested to review the proposed merge of ~kevinyeh/hwcert-jenkins-jobs:fix-running-script-sru into hwcert-jenkins-jobs:master.
diff --git a/jobs/sru/wait-resource.sh b/jobs/sru/wait-resource.sh
index 1cf487e..6b7052d 100644
--- a/jobs/sru/wait-resource.sh
+++ b/jobs/sru/wait-resource.sh
@@ -20,8 +20,8 @@
         function checkrtn {
           # pgrep only looks for the first 15 characters
           # use ps aux | grep instead
-          local status=\\\$(ps aux | grep \\\$1  | grep -v grep | wc -l)
-          local proc_name=\\\$(ps aux | grep \\\$1  | grep -v grep)
+          local status=\\\$(ps aux | grep -w \\\$1  | grep -v grep | wc -l)
+          local proc_name=\\\$(ps aux | grep -w \\\$1  | grep -v grep)
           echo \\\$proc_name
           return \\\$status
         }

Follow ups