home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / disk-man / linux-fl.000 / linux-fl / linux-floppies / mountb < prev    next >
Encoding:
Text File  |  1996-04-05  |  1.7 KB  |  74 lines

  1. #!/bin/sh
  2.  
  3. # ---------------------------------------------------
  4. # Script for mounting diskettes
  5. # ---------------------------------------------------
  6.  
  7. # ---- EDIT TO SUIT YOUR NEEDS -------
  8. # Put it in your path (/usr/local/lib).
  9.  
  10. # --- Device file that corresponds to your drive
  11. # DEVICE=/dev/fd1    # B: under DOS
  12.  
  13. DEVICE=/dev/fd0         # A: under DOS
  14.  
  15. # ---- Directory under which you want the contents of
  16. #      your directory to appear. It must exist already!!!
  17. #DIRECTORY=/a
  18.  
  19. DIRECTORY=/b
  20.  
  21. # ---- File system on that diskette
  22. # FILE_SYSTEM=msdos    # MS DOS file system
  23.  
  24. FILE_SYSTEM=ext2     # Linux Second Extended file system 
  25.  
  26. # ---- Certain options for mounting DOS diskettes
  27. #OPTIONS=conv=binary # No CR-LF (line termination) conversion
  28. #OPTIONS=conv=auto    # Intelligent line termination conversion
  29.              # text is converted, executables are not
  30.  
  31.  
  32. # ---- mount command ----
  33. # on success 0 is returned
  34. # on failure -1 is returned
  35. # erno is set uppropriately
  36.  
  37. # if executes everything following it
  38. # if the return status is success (0)
  39. #    then ... is executed
  40. #    else ... is executed
  41.  
  42. COLOR1="\033[37;44m"           # normal white  on blue 
  43. COLOR2="\033[1;6m\033[37;44m" # bright white  on blue 
  44. COLOR3="\033[1;6m\033[36;44m" # bright cyan on blue 
  45. COLOR4="\033[0m\033[34;47m"   # blue on normal white 
  46. COLOR5="\033[1;6m\033[31;40m" # bright red on black 
  47. COLOR6="\033[1;6m\033[37;41m" # bright white on red 
  48. COLOR_RESET="\033[0m" 
  49.  
  50.   
  51. if  mount -t $FILE_SYSTEM $DEVICE $DIRECTORY 2> /tmp/error.temp 
  52.     then 
  53.      echo -e $COLOR2 "  OK  " $COLOR4  $DIRECTORY is mounted \
  54.     $COLOR3 $FILE_SYSTEM filesystem  $COLOR_RESET 
  55.     ls /b
  56.     else
  57.     echo -e $COLOR6 "ERROR" $COLOR5 `cat /tmp/error.temp` $COLOR_RESET
  58. fi 
  59.  
  60. rm -f /tmp/error.temp 
  61.  
  62.   
  63.  
  64.  
  65.   
  66.  
  67.  
  68.  
  69.   
  70.  
  71.  
  72.  
  73.  
  74.