#!/bin/sh
 echo 'Starting updateagent self update.. ' > /sdcard/upd/rb_selfupdate.log
 if [ $1 = "test" ]; then
 cp /system/bin/ota/rtupdateagent /sdcard/upd/rb/rtupdateagent_old 
 /sdcard/upd/rb/rtupdateagent_old -delta=/sdcard/upd/rb/selfupdate_10.4.4__10.4.5.delta -fspart=system -result=/sdcard/upd/rtupdateresult.txt -op=test -verbose=1 -logfile=/sdcard/upd/rb_selfupdate.log -reboot=0
 else
 echo 'Starting agent self update.. ' > /sdcard/upd/rb_selfupdate.log
 mount -o rw,remount /system
 cp /system/bin/ota/rtupdateagent /sdcard/upd/rb/rtupdateagent_old 
 /sdcard/upd/rb/rtupdateagent_old -delta=/sdcard/upd/rb/selfupdate_10.4.4__10.4.5.delta -fspart=system -result=/sdcard/upd/rtupdateresult.txt -op=update -verbose=1 -logfile=/sdcard/upd/rb_selfupdate.log -reboot=0
 mount -o ro,remount /system
 fi

