#! /bin/sh
#
#   countdown.sh -- カウントダウンしつつ入力を待つ
#
#	0.0: May   5, 2009 by Dai ISHIJIMA (for wpout10)
#

count=9
prompt="Press ENTER to native console mode"

while [ $count -gt 0 ]; do
	echo -e "\r$prompt[$count] \c"
	if read -t 1 keyin 1>/dev/null 2>&1 ; then
		count=0
	fi
	count=$(( $count - 1 ))
done

case x"$count" in
	x0)
		echo ''
		echo 'No enter key'
		;;
esac

exit 0

# EOF
