#!/bin/sh
module="xpc4drvr"
device="xpc4_"
mode="666"

# Unload driver
#/sbin/rmmod $module || exit 1
/sbin/rmmod $module

# Load driver
# and use a pathname, as newer modutils don't look in . by default
#/sbin/insmod -f ./$module.o $* || exit 1
/sbin/insmod -f /lib/modules/misc/$module.o || exit 1

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

# Remove stale nodes and replace them, then give gid and perms

rm -f /dev/${device}[0-3]
mknod /dev/${device}0 c $major 0
mknod /dev/${device}1 c $major 1
mknod /dev/${device}2 c $major 2
mknod /dev/${device}3 c $major 3
ln -sf ${device}0 /dev/${device}
chmod $mode  /dev/${device}[0-3]

# End of file.
