#This file is for update firmware
#Version V18
#It will uzip firmwarev18.tgz and refresh /APP project
#!/bin/sh
    CPUType=0
    CPUInfo=`cat /proc/cpuinfo |grep Processor|grep PXA255`
    if [ $? = 0 ]; then
      #echo "CPU is PXA255"
      CPUType=1
    fi
    CPUInfo=`cat /proc/cpuinfo |grep Processor|grep ARMv7`
    if [ $? = 0 ]; then
      #echo "CPU is ARMv7"
      CPUType=2
    fi
    
    #This update is only for PXA255
    if [ $CPUType != "1" ]; then
      exit 1
    fi
    
    echo "Start Update"
    /bin/rm -Rf /APP/*
    /bin/tar -zxvf /home/ftp/firmwarev18.tgz -C /
    /bin/echo "M-4132 updatev18" >> /APP/log/Update
    echo "Update finish"
    
