2013-11-13 | Paul Boddie | raw files shortlog changelog graph | Added handling of any failure to mount the image. | |
uml-access-image (file) |
1.1 --- a/uml-access-image Wed Nov 13 00:13:33 2013 +0100 1.2 +++ b/uml-access-image Wed Nov 13 00:14:19 2013 +0100 1.3 @@ -37,7 +37,11 @@ 1.4 if [ ! -e "$IMAGEDIR" ]; then 1.5 mkdir "$IMAGEDIR" 1.6 fi 1.7 -sudo mount -o loop "$IMAGE" "$IMAGEDIR" 1.8 + 1.9 +if ! sudo mount -o loop "$IMAGE" "$IMAGEDIR" ; then 1.10 + echo "Could not mount the image." 1>&2 1.11 + exit 1 1.12 +fi 1.13 1.14 echo "Performing the requested activity..." 1>&2 1.15 "$COMMAND" $*