#!/bin/sh
module="kmbclow"
device="kmbclow"
mode="664"

# Group: since distributions do it differently, look for wheel or use staff
if grep '^staff:' /etc/group > /dev/null; then
    group="staff"
else
    group="wheel"
fi

# Check to make sure the kmbclow driver isn't already loaded before trying
# to load it again.
cat /proc/devices | grep kmbclow 2>&1 >/dev/null
RC=$?
if [ $RC -ne 0 ]
then
	/sbin/insmod -f /lib/modules/`uname -r`/misc/$module.ko $*
else
	echo "KMBC Already Loaded."
fi


# remove stale nodes
rm -f /dev/${device}? 

major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`

mknod /dev/${device}0 c $major 0
ln -sf ${device}0  /dev/${device}

# give appropriate group/permissions
chgrp $group /dev/${device}0
chmod $mode  /dev/${device}0
