#!/bin/sh
#
# LCDd          This shell script takes care of starting and stopping
#               the LCD daemon service.
# chkconfig: 2345 67 10
# description: Starts the LCD daemon services.
# processname: LCDd

# 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 LCDd: "
	daemon '/usr/local/sbin/LCDd -d CFontz "--device /dev/ttyS1 --contrast 100" -b open'
	echo
	touch /var/lock/subsys/LCDd
	action "Turning off LCD backlight: " "/usr/local/bin/backlight off"
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down LCDd: "
	killproc LCDd
	echo
	rm -f /var/lock/subsys/LCDd
	;;
  status)
	status LCDd
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: LCDd {start|stop|status|restart}"
	exit 1
esac

exit 0
