#!/bin/sh

lAudioTip=$1

script_path=`echo $0 | awk -F '/' '{for(i=2;i<NF;i++) printf"/"$i}'`
echo $script_path

DualSimEnable=`cat $script_path/dualSim.ini | ./busybox grep "dualSimEnable:" | ./busybox grep -v grep | sed 's/dualSimEnable://g' | sed 's/\r//g' | sed 's/\n//g' | sed "s/$(echo -e '\015')//g"`
if [ $? != 0 ]; then
	echo "cann't found dualSim ini config file"
	exit -1
fi


if [ "$DualSimEnable" = "yes" ];then
	mkdir -p /mnt/mtd/Flags/
	touch /mnt/mtd/Flags/DualSimFlag
	if [ "$lAudioTip" != "no" ];then
		./simple_adec_bind_ao -r 8000 -t g711a -i audio/dualcardsinglestandbySet_success.pcm
	fi
fi

if [ "$DualSimEnable" = "no" ];then
	rm -rf /mnt/mtd/Flags/DualSimFlag
	if [ "$lAudioTip" != "no" ];then
		./simple_adec_bind_ao -r 8000 -t g711a -i audio/dualcardsinglestandbyDel_success.pcm
	fi
fi
