#!/bin/sh

readonly NONE=0
readonly NORMAL_MODE=1
readonly RECOVERY_MODE=2
readonly RESOURCES_MODE=3
readonly MAPS_MODE=4
readonly PSPRIMA_MODE=5
readonly SELFUPDATE_MODE=6

stage=`getprop ota.update.stage`

if [ "$stage" = "$NORMAL_MODE" ]; then 
    /sdcard/upd/rb/normal.sh
    setprop ota.update.stage $NONE
fi

if [ "$stage" = "$RECOVERY_MODE" ]; then 
    /sdcard/upd/rb/recovery.sh
    setprop ota.update.stage $NONE
fi

if [ "$stage" = "$RESOURCES_MODE" ]; then
    /sdcard/upd/rb/resources.sh
    setprop ota.update.stage $NONE
fi

if [ "$stage" = "$MAPS_MODE" ]; then
    /sdcard/upd/rb/maps.sh
    setprop ota.update.stage $NONE
fi

if [ "$stage" = "$PSPRIMA_MODE" ]; then
    /sdcard/upd/rb/ps-prima2.sh
    setprop ota.update.stage $NONE
fi

if [ "$stage" = "$SELFUPDATE_MODE" ]; then
    /sdcard/upd/rb/selfupdate.sh
    setprop ota.update.stage $NONE
fi
