X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=clone%2Fvirt-sysprep.in;h=792282c7d6e6455acc70072bfb8387188d3d2f00;hp=b6c8a4041421355cf620e960be7721ca6aa95ba1;hb=11be7d8eee16e6249ed2868b5bd552f29508ec02;hpb=baa1618e0f917017c1934b7da41250029c1791ef diff --git a/clone/virt-sysprep.in b/clone/virt-sysprep.in index b6c8a40..792282c 100644 --- a/clone/virt-sysprep.in +++ b/clone/virt-sysprep.in @@ -175,16 +175,16 @@ if [ -z "$GUESTFISH_PID" ]; then exit 1 fi +# Helper. +gf="guestfish --remote --" + cleanup () { - kill $GUESTFISH_PID >/dev/null 2>&1 ||: + $gf exit >/dev/null 2>&1 ||: rm -rf "$tmpdir" ||: } trap cleanup EXIT ERR -# Helper. -gf="guestfish --remote --" - # Launch back-end, inspect for operating systems, and get the guest # root disk. root=$($gf inspect-get-roots)