home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / images / ramdisk2-beta.img / etc / pcmcia / ftl < prev    next >
Text File  |  1995-08-02  |  800b  |  38 lines

  1. #!/bin/sh
  2. #
  3. # ftl.sample 1.2 1995/05/25 04:27:58 (David Hinds)
  4. #
  5. # Initialize or shutdown an FTL memory device
  6. #
  7. # The first argument should be either 'start' or 'stop'.  The second
  8. # argument is the base name for the device.  When starting a device,
  9. # there should be two additional arguments, the major and minor device
  10. # numbers.
  11. #
  12. # This script creates one block device file, which maps the first
  13. # common memory region.
  14.  
  15. usage()
  16. {
  17.     echo "usage: ftl [action] [device name] [major] [minor]"
  18.     exit 1
  19. }
  20.  
  21. if [ $# -lt 2 ] ; then usage ; fi
  22. action=$1
  23. name=$2
  24.  
  25. case "${action:?}" in
  26. 'start')
  27.     if [ $# -ne 4 ] ; then usage ; fi
  28.     major=$3
  29.     minor=$4
  30.     rm -f /dev/${name}*
  31.     mknod /dev/${name} b $major $minor
  32.     ;;
  33. 'stop')
  34.     fuser -k /dev/${name}*
  35.     rm -f /dev/${name}*
  36.     ;;
  37. esac
  38.