#!/bin/sh

. /etc/init.d/functions.sh
. /etc/conf.d/artpec-3

start_module() {
	begin "Loading the ARTPEC-3 module"
	insmod $ARTPEC3_MODULE_NAME \
		nbr_of_sources=$ARTPEC3_NBR_OF_SOURCES
	end $?
}

stop_module()
{
	begin "Removing the ARTPEC-3 module"
	rmmod $ARTPEC3_MODULE_NAME
	end $?
}

case "$1" in
	start)
		start_module
		;;
	stop)
		stop_module
		;;
	restart)
		stop_module && start_module
		;;
	*)
		error "Usage: $0 start|stop|restart"
		;;
esac

exit 0
