#! /bin/sh
#
# cciss_char_interface - character device interface for cciss (hp smart array) \
#                        controllers and logical devices
#
# chkconfig: 35 2 2
# description: script makes cciss character device nodes and keeps these \
#              device special files up to date with proper major number
#

ReadDevices() {
   local minor=0
   while [ $# -gt 0 ] ; do
      local major= devname= ccisscharpath=

      major=${1} ; shift
      devname=${1} ; shift
      ccisscharpath=/dev/$devname

      if [ -n "$major" ]; then
         rm -f $ccisscharpath
         mknod $ccisscharpath c ${major} ${minor}
      fi
   done
}

start() {
   ReadDevices $(cat /proc/devices | grep 'cciss-')
   return 0
}

stop () {
   return 0
}

restart () {
   stop
   start
}

case "$1" in
  start)
   start
   ;;  
  stop)
   stop
   ;;  
  restart)
   restart
   ;;  
  *)  
   echo $"Usage: $0 {start|stop|restart}"
   exit 1
esac

exit $?
