#!/bin/sh
# Copyright C 2002-2011 by Isilon Systems, LLC. All rights not expressly
# granted herein are reserved.
# Created in the United States of America.
# 
# This digital media is protected by U.S. and international copyright and
# intellectual property laws. Unless otherwise specified, all information
# and screens appearing as part of this digital medium, including
# software, services, documents, text, images, icons, and logos design;
# the selection, assembly, arrangement, and design thereof; and the code
# that enables its presentation, are the sole property of Isilon Systems,
# LLC.
# 
# Except as otherwise required by applicable law, no part of any
# copyrighted material may be reproduced, modified, translated,
# distributed, published, or transmitted by any means, electronic or
# mechanical, for any purpose, without the prior written consent of Isilon
# Systems. 
#  
# Isilon and Isilon Systems are registered trademarks of Isilon Systems,
# LLC.  Legion is a trademark of Isilon Systems, LLC.  All other
# trademarks and registered trademarks are the property of their
# respective holders.
#
# Code to initialize LCD panel
#
# PROVIDE: isi_lcd
# REQUIRE: isi_hal_init

. /etc/rc.subr

name="isi_lcd"
start_cmd="isi_lcd_start"

isi_lcd_start()
{
	#if we have an lcd front panel, initialize it and start the daemon for it
	/usr/bin/isi_hwtools/isi_hal_predicate hasFrontPanelDisplay > /dev/null 2>&1
	has_front_panel_display=$?

	if [ ${has_front_panel_display} -eq 1 ]; then
		case ${isi_lcd_enable} in
		[Yy][Ee][Ss])
			if [ -x /usr/bin/isi_lcd_d ]; then
				/usr/bin/isi_lcd_init
				if [ $? -eq 0 ]; then
					/usr/bin/isi_lcd_d start
				fi
			fi
			;;
		esac
	fi
}

load_rc_config $name
run_rc_command "$1"
