#!/bin/sh

# ---------------------------------------------------
# Script for mounting diskettes
# ---------------------------------------------------

# ---- EDIT TO SUIT YOUR NEEDS -------
# Put it in your path (/usr/local/lib).

# --- Device file that corresponds to your drive
# DEVICE=/dev/fd1	# B: under DOS

DEVICE=/dev/fd0         # A: under DOS

# ---- Directory under which you want the contents of
#      your directory to appear. It must exist already!!!
#DIRECTORY=/a

DIRECTORY=/b

# ---- File system on that diskette
# FILE_SYSTEM=msdos	# MS DOS file system

FILE_SYSTEM=ext2 	# Linux Second Extended file system 

# ---- Certain options for mounting DOS diskettes
#OPTIONS=conv=binary # No CR-LF (line termination) conversion
#OPTIONS=conv=auto    # Intelligent line termination conversion
		     # text is converted, executables are not


# ---- mount command ----
# on success 0 is returned
# on failure -1 is returned
# erno is set uppropriately

# if executes everything following it
# if the return status is success (0)
#	then ... is executed
#	else ... is executed

COLOR1="\033[37;44m" 	      # normal white  on blue 
COLOR2="\033[1;6m\033[37;44m" # bright white  on blue 
COLOR3="\033[1;6m\033[36;44m" # bright cyan on blue 
COLOR4="\033[0m\033[34;47m"   # blue on normal white 
COLOR5="\033[1;6m\033[31;40m" # bright red on black 
COLOR6="\033[1;6m\033[37;41m" # bright white on red 
COLOR_RESET="\033[0m" 

  
if  mount -t $FILE_SYSTEM $DEVICE $DIRECTORY 2> /tmp/error.temp 
    then 
 	echo -e $COLOR2 "  OK  " $COLOR4  $DIRECTORY is mounted \
	$COLOR3 $FILE_SYSTEM filesystem  $COLOR_RESET 
	ls /b
    else
	echo -e $COLOR6 "ERROR" $COLOR5 `cat /tmp/error.temp` $COLOR_RESET
fi 

rm -f /tmp/error.temp 

  


  



  




