Fix error when cleanup is called before nbd_dev is set
This commit is contained in:
parent
5059118e8c
commit
fb0ad9b107
1 changed files with 4 additions and 3 deletions
|
@ -117,9 +117,10 @@ cleanup() {
|
|||
|| die "Failed to unmount $mount_dir; unmount it and disconnect $nbd_dev manually"
|
||||
rm -Rf "$mount_dir" || :
|
||||
fi
|
||||
qemu-nbd --disconnect "$nbd_dev" \
|
||||
|| die "Failed to disconnect $nbd_dev; disconnect it manually"
|
||||
|
||||
if [ -n "$nbd_dev" ]; then
|
||||
qemu-nbd --disconnect "$nbd_dev" \
|
||||
|| die "Failed to disconnect $nbd_dev; disconnect it manually"
|
||||
fi
|
||||
if [ "$INSTALL_HOST_PKGS" = yes ]; then
|
||||
_apk del $VIRTUAL_PKG
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue