mirror of
https://abf.rosa.ru/djam/qemoo.git
synced 2025-02-23 17:12:57 +00:00
exit if getting the IMG format failed
This commit is contained in:
parent
4cef7b590f
commit
4a245d78a1
2 changed files with 5 additions and 2 deletions
5
qemoo
5
qemoo
|
@ -166,7 +166,10 @@ if ! command -V "$QEMU" >/dev/null; then
|
|||
exit ${LINENO}
|
||||
fi
|
||||
|
||||
IMGFORMAT="$(qemu-img info $IMG |grep 'format:' |cut -d' ' -f3)"
|
||||
set -o pipefail
|
||||
IMGFORMAT="$(qemu-img info "$IMG" |grep 'format:' |cut -d' ' -f3)" || exit ${LINENO}
|
||||
set +o pipefail
|
||||
|
||||
if [ "$LOSETUP" -a "$IMGFORMAT" = "raw" ] && echo "$IMG" |grep -qv '^/dev/'; then
|
||||
LOOPDEV="$(losetup -f)"
|
||||
losetup $LOOPDEV $IMG && { IMG="$LOOPDEV"; trap "losetup -d $LOOPDEV" EXIT; } || exit ${LINENO}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Summary: Wrapper for qemu to easy run guest machines
|
||||
Name: qemoo
|
||||
Version: 0.6
|
||||
Release: 3
|
||||
Release: 4
|
||||
License: GPLv2+
|
||||
Group: System/Base
|
||||
Url: https://abf.io/import/qemoo
|
||||
|
|
Loading…
Add table
Reference in a new issue