#!/bin/sh
#
# microcode_ctl:	Update Microcode for IA32
# chkconfig:		2345 01 99
# description:		Update Microcode for IA32 family processors
#
# $Id: microcode_ctl.init,v 1.9 2006/08/31 21:08:15 glen Exp $


# Source function library
. /etc/rc.d/init.d/functions

RETVAL=0
# See how we were called.
case "$1" in
  start)
	# Check if the service is already running?
	if [ ! -f /var/lock/subsys/microcode_ctl ]; then
		msg_starting "IA32 Microcode Update"
		_modprobe -s microcode
		daemon /usr/sbin/microcode_ctl -u
		RETVAL=$?
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/microcode_ctl
	else
		msg_already_running microcode_ctl
	fi
	;;
  stop)
	[ -f /var/lock/subsys/microcode_ctl ] && rm -f /var/lock/subsys/microcode_ctl
	;;
  restart|reload|force-reload)
	$0 stop
	$0 start
	exit $?
	;;
  status)
	status microcode_ctl
	exit $?
	;;
  *)
	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
	exit 3
esac

exit $RETVAL

# This must be last line !
# vi:syntax=sh:tw=78
