Skip to content

Commit

Permalink
add trap
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lange committed Sep 8, 2016
1 parent 4f58660 commit c67e3d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/fai-diskimage
Expand Up @@ -145,14 +145,15 @@ loopdev=${loop/\/dev\//}
export disklist=$loopdev
mnt=$(mktemp -d -t fai-diskimage.XXXXXX)

# set cleanup trap
trap "cleanup" ERR

LC_ALL=C fai -u $hname -s $uri -c$classes install $mnt

# do not umount for debugging purpose
# sleep 6666 | true

cleanup
trap - ERR

set +e
# convert if needed
Expand Down

0 comments on commit c67e3d7

Please sign in to comment.