#!/bin/sh

KERN_RELEASE=`uname -r`
LIBDIR="/lib/modules/$KERN_RELEASE/$MDIR"

module="h57fmb"

#
# Check root account
#
uid=`id | sed 's/uid=//' | sed 's/(.*//'`
if [ $uid != 0 ]; then
    echo "ERROR: You are not root.!!"
    exit
fi

#
# Unload old driver module
#
grep $module /proc/modules > /dev/null
if [ $? = 0 ];then
    echo -n "Unloading old MB86H57 device driver..."
    /sbin/rmmod $module
    echo "done."
fi

#
# Load new driver module
#
echo -n "Loading new MB86H57 device driver..."
/sbin/insmod $LIBDIR/$module.ko
# /sbin/insmod $LIBDIR/$module.ko msg_lvl=0x3ff
# /sbin/insmod $LIBDIR/$module.ko msg_lvl=0x1ff
echo "done."
