#!/bin/sh /etc/rc.common
START=99

RETRY_CNT_FILE="/boot/try_data_ubi_recover"

start() {
	[ -e $RETRY_CNT_FILE ] && {
		retry=`cat $RETRY_CNT_FILE`
		if [ "$retry" -eq 0 ]; then
			echo "[/etc/init.d/check_ubi_recover] Data section is successfully recovered." > /dev/console
			/usr/bin/logger "[BOOT][check_ubi_recover] Data section is successfully recovered."
			rm -f $RETRY_CNT_FILE
		else
			echo "[/etc/init.d/check_ubi_recover] Data section corrupted and cannot be recovered." > /dev/console
			/usr/bin/logger "[BOOT][check_ubi_recover] Data section corrupted and cannot be recovered."
		fi
	}
}
