#!/bin/bash
if [ $1 -eq 0 ]
then
a=$(lsmod | grep "ipmi_msghandler" | wc -l) 

if [ $a -eq 0 ]
then
	exit $a
fi

a=$(lsmod | grep "ipmi_si" | wc -l)

if [ $a -eq 0 ]
then
	exit $a
fi

a=$(lsmod | grep "ipmi_devintf" | wc -l)

if [ $a -eq 0 ]
then
	exit $a
fi
exit $a
fi

if [ $1 -eq 1 ]
then 
$(rmmod ipmi_si)
$(rmmod ipmi_devintf)
$(rmmod ipmi_msghandler)
fi

if [ $1 -eq 2 ]
then 
$(modprobe ipmi_si)
$(modprobe ipmi_devintf)
$(modprobe ipmi_msghandler)
fi
