@ -171,6 +171,7 @@ function get_new_context {
;;
;;
esac
esac
_mount_dir_mounted=no
if [ -e "${dev_context}" ]; then
if [ -e "${dev_context}" ]; then
mount_dir
mount_dir
@ -198,6 +199,7 @@ function get_new_context {
exit 1
exit 1
fi
fi
_mount_dir_mounted=yes
context_sh $MOUNT_DIR
context_sh $MOUNT_DIR
elif find '/context' -mindepth 1 -print 2>/dev/null | grep -q .; then
elif find '/context' -mindepth 1 -print 2>/dev/null | grep -q .; then
@ -308,7 +310,7 @@ function acquire_lock {
function cleanup {
function cleanup {
# unmount context
# unmount context
if [ -d "${MOUNT_DIR}" ]; then
if [ -d "${MOUNT_DIR}" ]; then
if mount | grep -q " ${MOUNT_DIR} " ; then
if [ "x${_mount_dir_mounted}" = 'xyes' ] ; then
log debug "Unmounting ${MOUNT_DIR}"
log debug "Unmounting ${MOUNT_DIR}"
if [ "$distro" = 'Linux' ]; then
if [ "$distro" = 'Linux' ]; then
@ -318,7 +320,7 @@ function cleanup {
fi
fi
fi
fi
rm -r "${MOUNT_DIR}"
rm -rf "${MOUNT_DIR}"
fi
fi
# remove remporary files
# remove remporary files