#!/bin/bash
# umountizo - Cleanly unmount all InterMezzo filesystems

# Hacked for installation by Gordon Matzigkeit <gord@fig.org>, 2000-11-13
thisdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "X$thisdir" = "X$0" && thisdir=.

if test -f $thisdir/closejournal.pl; then
 # Running out of source directory.
 CLOSEJOURNAL="perl $thisdir/closejournal.pl"
elif test -f $thisdir/closejournal; then
 # Installed.
 CLOSEJOURNAL=$thisdir/closejournal
else
 # Unknown.
 CLOSEJOURNAL=closejournal
fi

for i in `mount | grep InterMezzo | awk '{print $3}'`; do
 $CLOSEJOURNAL $i
 umount $i
done
