#!/bin/sh

set -e

BUILDDIR=${BUILDDIR:-/tmp/buildd} # stay compatible with pbuilder << 0.217

if [ -d /tmp/disorderfs ] ; then
	echo -n "Unmounting /tmp/disorderfs…"
	fusermount -u "$BUILDDIR"
	rmdir "$BUILDDIR"
	mv /tmp/disorderfs "$BUILDDIR"
	echo " done."
fi
