#!/bin/sh

#
# uit 4.2c auto-mount script. For Linux only.
#

name=`basename $0`

if [ $# != 1 ]
then
    echo usage: ${name} device  "    (ex:  " $name fd0 ")"
    exit 1
fi

for fstype in ext2 msdos minix ext xiafs hpfs
do
    echo checking for $fstype file system ...
    mount -t $fstype /dev/$1 /mnt/$1 > /dev/null 2> /dev/null
    ok=$?
    if [ $ok = 0 ]
    then
	echo $fstype file system succesfully mounted
	exit 0
    fi
done

echo wrong fs type, /dev/$1 already mounted, /mnt/$1 busy, or other error >&2
exit 1
