#!/bin/sh	

case "$1" in
	start)
		if [ -r "/etc/config/open2x_lcdsettings.conf" ]; then
			buttonquery -s9
			if [ "$?" -eq 0 ]; then
				echo "Loading saved LCD timings..."
				# Select button is not pressed, so load any saved timings
				cd /opt/lcdtimings
				./lcdtimings_cli -f /etc/config/open2x_lcdsettings.conf&
			else
				echo "Bypassing loading of saved LCD settings"
			fi
		else
			echo "Couldn't find /etc/config/open2x_lcdsettings.conf file, skipping."
		fi
		;;
  *)
	echo $"Usage: $0 {start}"
	exit 1
esac

