#!/bin/sh

###############################################################################
#									      #
#		  GNU Interactive Tools 4.3.6 auto-mount script		      #
#		Copyright (C) 1994 Free Software Foundation, Inc.	      #
#		    Written by Tudor Hulubei and Andrei Pitis.		      #
#									      #
###############################################################################

#
# This script is for Linux only.
# The ideea of this script is quite general but the script needs
# some changes in order to run on other UNIX systems.
# The major change is in the file system types list.
#
# If you enhance this script, please send me a patch (tudor@cs.pub.ro).
# I'll include it in the next release.
#

name=`basename $0`

if test $# != 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 test $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
