#!/bin/sh
module="cpint"
device="cpint"
group="wheel"
mode="660"

# invoke insmod with all arguments we got
/sbin/insmod -f $module $* || exit 1

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

# Remove stale nodes and replace them, then give gid and perms
# Usually the script is shorter, it's cpcmd that has several devices in it.

rm -f /dev/${device}*
mknod /dev/${device}0   c $major 0
mknod /dev/${device}8   c $major 8
mknod /dev/${device}76  c $major 76
mknod /dev/${device}220 c $major 220
ln -sf /dev/${device}8   /dev/cpcmd
ln -sf /dev/${device}76  /dev/cpact
ln -sf /dev/${device}220 /dev/cpmon
chgrp $group /dev/${device}*
chmod $mode  /dev/${device}*
