xci: scripts: start-new-vm: Mask the pgrep exit code 35/52735/1
authorMarkos Chandras <mchandras@suse.de>
Tue, 27 Feb 2018 12:10:17 +0000 (12:10 +0000)
committerMarkos Chandras <mchandras@suse.de>
Tue, 27 Feb 2018 12:12:13 +0000 (12:12 +0000)
pgrep will exit with non-zero exit code if it didn't find a matching
process. This breaks the script since we set 'errexit' so we need to
mask it by simply piping it to a 'cat' command.

Change-Id: I80dcf06b597a769242bd59d628bbd8e09f0f199e
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/scripts/vm/start-new-vm.sh

index 5f7fe59..f53ec5e 100755 (executable)
@@ -127,7 +127,7 @@ esac
 
 echo "Checking for running package manager instance..."
 while true; do
-       _pkg_mgr_proc=$(pgrep -f "${pkg_mgr_cmd%*install*}")
+       _pkg_mgr_proc=$(pgrep -f "${pkg_mgr_cmd%*install*}" | cat)
        if [[ -n ${_pkg_mgr_proc} ]]; then
                echo "Wainting for process ${_pkg_mgr_proc} to finish..."
                sleep 60