#  iAPX286 @(#)bsetdate.sh	1.1
#  Check and set date

. /etc/TIMEZONE

	date `/etc/time` >/dev/null

while :
do
	echo "Is the date `date` correct? (y or n) \c"
	read reply
	if
		[ "$reply" = y ]
	then
		break
	else
		echo "Enter the correct date: (MMddhhmmyy) \c"
		read reply
		date "$reply" >/dev/null
		newdate=`date +%m%d%H%M%y`
		year=`date +%y`
		if [ `expr $year % 4` = 0 ]
		then
			mthday=`date +%m%d`
			if [ `date +%m%d` -eq 0301 ]
			then
				echo "$newdate"x > /etc/odate
			else
				echo "$newdate" > /etc/odate
			fi
		fi
		date +%m%d%H%M%y >/dev/time
	fi
done

