Disable -e inside cleanup()
This commit is contained in:
parent
84d01a86c3
commit
bdde467433
1 changed files with 3 additions and 3 deletions
|
@ -105,17 +105,17 @@ help() {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
set +u
|
set +eu
|
||||||
trap '' EXIT HUP INT TERM # unset trap to avoid loop
|
trap '' EXIT HUP INT TERM # unset trap to avoid loop
|
||||||
|
|
||||||
cd /
|
cd /
|
||||||
if [ -d "$temp_dir" ]; then
|
if [ -d "$temp_dir" ]; then
|
||||||
rm -Rf "$temp_dir" || :
|
rm -Rf "$temp_dir"
|
||||||
fi
|
fi
|
||||||
if [ "$mount_dir" ]; then
|
if [ "$mount_dir" ]; then
|
||||||
umount_recursively "$mount_dir" \
|
umount_recursively "$mount_dir" \
|
||||||
|| die "Failed to unmount $mount_dir; unmount it and disconnect $nbd_dev manually"
|
|| die "Failed to unmount $mount_dir; unmount it and disconnect $nbd_dev manually"
|
||||||
rm -Rf "$mount_dir" || :
|
rm -Rf "$mount_dir"
|
||||||
fi
|
fi
|
||||||
if [ "$nbd_dev" ]; then
|
if [ "$nbd_dev" ]; then
|
||||||
qemu-nbd --disconnect "$nbd_dev" \
|
qemu-nbd --disconnect "$nbd_dev" \
|
||||||
|
|
Loading…
Reference in a new issue