#!/bin/sh
#
# irexec        This shell script takes care of starting and stopping
#               the Infrared Exec service.
# chkconfig: 2345 66 10
# description: Starts the irexec daemon service.
# processname: irexec 

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

# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
    exit 0
fi

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting irexec: "
	daemon /usr/local/bin/irexec -d /usr/local/etc/lirc.conf
	echo
	touch /var/lock/subsys/irexec
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down irexec: "
	killproc irexec
	echo
	rm -f /var/lock/subsys/irexec
	;;
  status)
	status irexec
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: irexec {start|stop|status|restart}"
	exit 1
esac

exit 0
