home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20101108.etc.tar.gz / bradford.20101108.etc.tar / etc / init.d / raw < prev    next >
Text File  |  2006-05-02  |  1KB  |  62 lines

  1. #! /bin/sh
  2. # Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany.
  3. #
  4. # Author: Dirk Lerner <feedback@suse.de>
  5. #
  6. # /etc/init.d/raw
  7. #
  8. #   and symbolic its link
  9. #
  10. # /usr/sbin/rcraw
  11. #
  12. ### BEGIN INIT INFO
  13. # Provides:       raw
  14. # Required-Start: $local_fs $remote_fs 
  15. # Required-Stop:
  16. # Default-Start:  2 3 5
  17. # Default-Stop:   0 1 6
  18. # Description:    raw-devices
  19. ### END INIT INFO
  20.  
  21. . /etc/rc.status
  22.  
  23. CONFIG=/etc/raw
  24. RAW_BIN=/usr/sbin/raw
  25. RAW_MODULE=raw
  26. test -x $RAW_BIN || exit 5
  27.  
  28. if [ ! -f $CONFIG ];then
  29.  echo "file: $CONFIG not found"
  30.  exit 6
  31. fi
  32.  
  33. rc_reset
  34. case "$1" in
  35.     start)
  36.       /sbin/modprobe $RAW_MODULE && sleep 2
  37.       line=`grep -v ^# < $CONFIG`
  38.       
  39.       for i in $line;do
  40.         rawdev=`echo $i | cut -f1 -d:`
  41.         rawbind=`echo $i | cut -f2- -d:`
  42.         echo -n "bind /dev/raw/$rawdev to /dev/$rawbind..."
  43.         $RAW_BIN /dev/raw/$rawdev /dev/$rawbind > /dev/null 2>&1 
  44.     rc_status -v
  45.       done
  46.       ;;
  47.     stop)
  48.       echo -n "to unbind the rawdevice please perform a system shutdown"
  49.       rc_failed 3
  50.       rc_status -v
  51.       ;;
  52.     status)
  53.       $RAW_BIN -qa 2> /dev/null
  54.       rc_status -v
  55.       ;;
  56.     *)
  57.       echo "Usage: $0 {start|stop|status}"
  58.       exit 1
  59.       ;;
  60. esac
  61. rc_exit
  62.