#!/bin/sh
 if [ ! -f "/sdcard/upd/rb/rtupdateagent" ]; then
 cp /system/bin/ota/rtupdateagent /sdcard/upd/rb/rtupdateagent 
 fi 
 rm /tmp/mcu_*
 cp /system/vendor/roadtrack/firmware/mcu_* /tmp/
 echo 'Starting mcu update test.. ' > /sdcard/upd/rb_mcu.log
 if [ $1 = "test" ]; then
 /sdcard/upd/rb/rtupdateagent -delta=/sdcard/upd/rb/mcu_04.18.10CLEA-14-06__05.003.004CLEA-15-06.delta -fspart=tmp -result=/sdcard/upd/rtupdateresult.txt -op=test -verbose=1 -logfile=/sdcard/upd/rb_mcu.log -reboot=0
 else
 echo 'Starting mcu update.. ' > /sdcard/upd/rb_mcu.log
 /sdcard/upd/rb/rtupdateagent -delta=/sdcard/upd/rb/mcu_04.18.10CLEA-14-06__05.003.004CLEA-15-06.delta -fspart=tmp -result=/sdcard/upd/rtupdateresult.txt -op=update -verbose=1 -logfile=/sdcard/upd/rb_mcu.log -reboot=0
 rm /sdcard/upd/mcu/mcu_* >> /sdcard/upd/rb_mcu.log
 cp /tmp/mcu_* sdcard/upd/mcu/ >> /sdcard/upd/rb_mcu.log 
 echo 'Done mcu update' >> /sdcard/upd/rb_mcu.log
 fi

