#!/bin/sh

INSTALL_DIR=/usr/lib/slmdm

INF_DEVICE=slinf

maj_no=`awk "/^[0-9]* ${INF_DEVICE}\$/ {print \\\$1}" /proc/devices `

if [ -z "$maj_no" ] ; then
 echo "cannot find device ${INF_DEVICE}. exit"
 exit 1
fi

if [ `echo $maj_no | wc -w ` -gt 1 ] ; then
 echo "multiple devices ${INF_DEVICE}. exit."
 exit 2
fi

rm -f /dev/${INF_DEVICE}
mknod /dev/${INF_DEVICE} c $maj_no 0 > /dev/null 2>&1
if [ $? -ne 0 ] ; then
  echo "cannot create node /dev/${INF_DEVICE}. exit."
  exit -1
fi


${INSTALL_DIR}/infload ${INSTALL_DIR}/m.info
if [ $? -ne 0 ] ; then
  echo "cannot load inffile. exit."
  exit -1
fi

rm -f /dev/${INF_DEVICE}

exit 0

