+function bailout(){
+ # make sure $TARGET is not mounted when exiting grml-debootstrap
+ if [ -n "$TARGET" ] ; then
+ if grep -q $TARGET /proc/mounts ; then
+ echo "Unmounting $TARGET"
+ umount "$TARGET"
+ fi
+ fi
+ [ -n "$1" ] && EXIT="$1" || EXIT="1"
+ exit "$EXIT"
+}
+
+trap bailout 1 2 3 15
+
+# user should recheck his configuration
+einfo "$0 - Please recheck configuration before execution:"
+echo "
+ Target partition: $TARGET
+ Mount-point: $MNTPOINT
+ Install grub to: $GROOT / $GRUB [if empty grub will not be installed]
+
+ Important! Continuing will delete all data from ${TARGET}!
+"
+einfon "Is this ok for you? [y/N] "
+
+read a
+if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
+ eerror "Exiting as requested." ; eend 1
+ exit 1
+fi
+