From: Michael Prokop Date: Sun, 7 Jun 2009 23:56:57 +0000 (+0200) Subject: grml2iso: drop $WRKDIR if it did not exist before execution X-Git-Tag: v0.9.8~10 X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=commitdiff_plain;h=a93ae86b2c66fa1abecb86ef52f4b1e82700c5e2;hp=c405c60270992217b4485dbcd0ba4c9bf258fa0b grml2iso: drop $WRKDIR if it did not exist before execution --- diff --git a/grml2iso b/grml2iso index f1e966f..23b693d 100755 --- a/grml2iso +++ b/grml2iso @@ -78,6 +78,7 @@ # }}} # create necessary stuff under WRKDIR {{{ + [ -d "$WRKDIR" ] && WRKDIR_EXISTED='true' || WRKDIR_EXISTED='false' rm -rf "$WRKDIR/cddir" "$WRKDIR/grub_tmp" mkdir -p "$WRKDIR/cddir" "$WRKDIR/grub_tmp" # }}}} @@ -136,6 +137,7 @@ cd "$ORIG_DIR" sync rm -rf "$WRKDIR/cddir" "$WRKDIR/grub_tmp" + [[ $WRKDIR_EXISTED = 'false' ]] && rmdir "$WRKDIR" echo "Generated $ISOFILE" # }}}