#!/bin/sh
if [ -z "$1" ];then
echo "!!!input 2G or 3G!!!!"
exit 0
fi
if [ "$1" == "2G" ];then
modem_path=../$1_modem
rm -rf $modem_path
mkdir $modem_path
ext_2g="1_2g_n"
cp -fv ./build/*_JB5_GPRS/DEFAULT/bin/*.bin $modem_path/modem_$ext_2g.img
cp -fv ./build/*_JB5_GPRS/DEFAULT/bin/[a-Z]*_JB5_*.mak $modem_path/modem_$ext_2g.mak
cp -fv ./build/*_JB5_GPRS/DEFAULT/bin/*_JB5_*.elf $modem_path/
cp -fv ./build/*_JB5_GPRS/DEFAULT/tst/database/catcher_filter.bin $modem_path/catcher_filter_$ext_2g.bin
cp -fv ./build/*_JB5_GPRS/DEFAULT/tst/database/DbgInfo_WR8* $modem_path/
cp -fv ./build/*_JB5_GPRS/DEFAULT/tst/database/BPLGUInfoCustomAppSrcP*[0-9] $modem_path/
ls $modem_path/*.elf|while read fn;do mv -fv $fn ${fn%.*}_$ext_2g.elf ;done
ls $modem_path/BPLGUInfoCustomAppSrcP*|while read fn;do mv -fv $fn ${fn}_$ext_2g ;done
ls $modem_path/DbgInfo_WR8*|while read fn;do mv -fv $fn ${fn}_$ext_2g ;done
exit 0
fi
if [ "$1" == "3G" ];then
modem_path=../$1_modem
rm -rf $modem_path
mkdir $modem_path
ext_3g="1_wg_n"
cp -fv ./build/*_JB5_HSPA/DEFAULT/bin/*.bin $modem_path/modem_$ext_3g.img
cp -fv ./build/*_JB5_HSPA/DEFAULT/bin/[a-Z]*_JB5_*.mak $modem_path/modem_$ext_3g.mak
cp -fv ./build/*_JB5_HSPA/DEFAULT/bin/*_JB5_*.elf $modem_path/
cp -fv ./build/*_JB5_HSPA/DEFAULT/tst/database/catcher_filter.bin $modem_path/catcher_filter_$ext_3g.bin
cp -fv ./build/*_JB5_HSPA/DEFAULT/tst/database/DbgInfo_WR8* $modem_path/
cp -fv ./build/*_JB5_HSPA/DEFAULT/tst/database/BPLGUInfoCustomAppSrcP*[0-9] $modem_path/
ls $modem_path/*.elf|while read fn;do mv -fv $fn ${fn%.*}_$ext_3g.elf ;done
ls $modem_path/BPLGUInfoCustomAppSrcP*|while read fn;do mv -fv $fn ${fn}_$ext_3g ;done
ls $modem_path/DbgInfo_WR8*|while read fn;do mv -fv $fn ${fn}_$ext_3g ;done
exit 0
fi
echo "!!!!!!!!!!!!!!bad arg,input 2G or 3G!!!!!!!!!!!!!!!!!"