#!/bin/sh -e

##########################################################################
#   Script description:
#       
#   Arguments:
#       
#   Returns:
#       
#   History:
#   Date        Name        Modification
#   2015-12-27  Charlie &   Begin
##########################################################################

usage()
{
    printf "Usage: $0 device mount-point\n"
    exit 1
}


##########################################################################
#   Main
##########################################################################

if [ $# != 2 ]; then
    usage
fi

dev=$1
mount_point=$2
    
case $(auto-ostype) in
FreeBSD)
    # Try mounting various filesystems
    for fs in ufs msdosfs ntfs cd9660; do
	if mount -t $fs $dev $mount_point; then
	    printf "Mounted $fs.\n"
	    exit 0
	fi
    done
    
    printf "Unable to mount: Unknown filesystem.\n"
    exit 1
    ;;
    
*)
    auto-unsupported-os $0
    exit 1
    ;;

esac
