#!/bin/sh

while [ 1 ]
do
    # factory reset or no
    reset=`cat /sys/class/gpio/gpio143/value`
    if [ "${reset}" = 0 ];then
        sleep 3
    fi
    reset=`cat /sys/class/gpio/gpio143/value`
    if [ "${reset}" = 0 ];then
        /etc/scripts/play_rebooting.sh
        /etc/scripts/shell_action.sh rebootIpc
        /etc/scripts/shell_action.sh showReboot
        sleep 1
        rm -f /oem/.userdata && /sbin/reboot
        exit

    fi
    sleep 1
done