diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2012-12-05 19:58:18 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2012-12-07 08:17:00 +0100 |
commit | 38704c6597338c5536e0cc3a50139b806a32c1ed (patch) | |
tree | 2e69cd413866cc0485cfbcc99c9c5ab86fe2703a | |
parent | fe5a9f417f93a0709031eea6e5ea21228b191079 (diff) | |
download | jenkins.debian.net-38704c6597338c5536e0cc3a50139b806a32c1ed.tar.xz |
Avoid some useless grep calls, and make kill command more robust.
-rwxr-xr-x | bin/cd_tester.sh | 4 |
1 files changed, 2 insertions, 2 deletions
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 |