#! /bin/sh
if read -t 2 -p "please enter any key to stop reboot:" key
then
echo "stop exec reboot!"
else
echo "no input, reboot now!"
if [ ! -e "/etc/init.d/reboot_cnt" ];then
touch /etc/init.d/reboot_cnt
echo 1 > /etc/init.d/reboot_cnt
else
count=`cat /etc/init.d/reboot_cnt`
let count++
echo $count > /etc/init.d/reboot_cnt
/data/MIPITest &
sleep 10s
echo 1 > /proc/rp_gpio/gpioa1
sleep 10s
sync
reboot -f
fi
fi