#! /bin/sh
#
# kernel_mods 	load and unload firebll modules
#
# Version:      @(#)kernel_mods 1.0	Sven_Dietrich@trimble.com 1/26/02
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin

# Path to the user_stinger binary.
RETVAL=0

# SPI is now built into the kernel.
MODULES="ppp_deflate"
START_MODULES="$MODULES maxwell_serial gps_data"

# reverse the USER_INS_LIST to create a removal sequence for user modules
STOP_MODULES=""
for modules in $MODULES; do
    TEMP=`echo $modules | sed -e s/"\.o"$//`
    USER_DEL_LIST="$TEMP $STOP_MODULES"
done



start() {
        echo $"Loading modules... "
        for modules in $START_MODULES; do
	  modprobe $modules
        done 
        return $RETVAL
	}
stop() {
        echo $"Stopping modules... "
        for modules in $STOP_MODULES; do
          echo $modules
	  rmmod -v $modules
        done 
        return $RETVAL
	}

# See how we were called.
case "$1" in
  start)
          start 
	  ;; 
  stop) 
  	  stop 
	  ;; 
  restart)
        stop 
	start 
	;;
   *)
        echo $"Usage: $prog {start|stop|restart}"
        exit 1
esac

exit $RETVAL

