#!/bin/sh
#
# lircd         This shell script takes care of starting and stopping
#               the Linux Infrared Remote Control service.
# chkconfig: 2345 65 10
# description: Starts the lirc daemon service.
# processname: lircd

# 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 lircd: "
	daemon /usr/local/sbin/lircd
	echo
	touch /var/lock/subsys/lircd
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down lircd: "
	killproc lircd
	echo
	rm -f /var/lock/subsys/lircd
	;;
  status)
	status lircd
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: lircd {start|stop|status|restart}"
	exit 1
esac

exit 0
