From 38704c6597338c5536e0cc3a50139b806a32c1ed Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Wed, 5 Dec 2012 19:58:18 +0100 Subject: Avoid some useless grep calls, and make kill command more robust. --- bin/cd_tester.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/cd_tester.sh b/bin/cd_tester.sh index 1c915119..bd738cf1 100755 --- a/bin/cd_tester.sh +++ b/bin/cd_tester.sh @@ -69,7 +69,7 @@ cleanup_all() { # # kill qemu and image # - sudo kill -9 $(ps fax | grep -v grep | grep qemu-system | grep ${NAME}-preseed.cfg 2>/dev/null | cut -d "?" -f1) || true + sudo kill -9 $(ps fax | grep [q]emu-system | grep ${NAME}-preseed.cfg 2>/dev/null | awk '{print $1}') || true sleep 0.3s rm $WORKSPACE/$NAME.raw # @@ -180,7 +180,7 @@ if [ ! -z $IMAGE ] ; then curl $CURLOPTS -o $IMAGE $URL sudo mkdir -p $IMAGE_MNT - mount | grep -v grep | grep $IMAGE_MNT && sudo umount -l $IMAGE_MNT + grep -q $IMAGE_MNT /proc/mounts && sudo umount -l $IMAGE_MNT sleep 1 sudo mount -o loop,ro $IMAGE $IMAGE_MNT else -- cgit v1.2.3-70-g09d2