#!/bin/sh
module="silly"
device="silly"
mode="666"

# 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


# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
/sbin/insmod ./$module.ko $* option=2|| exit 1

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

rm -f /dev/${device}b /dev/${device}w /dev/${device}l /dev/${device}cp
mknod /dev/${device}b c $major 0
mknod /dev/${device}w c $major 1
mknod /dev/${device}l c $major 2
mknod /dev/${device}cp c $major 3

chmod $mode /dev/${device}*





