#!/bin/sh

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

HardAudioTest=`cat $script_path/aging_test.ini | ./busybox grep "hardAudioTest:" | ./busybox grep -v grep | sed 's/hardAudioTest://g' | sed 's/\r//g' | sed 's/\n//g' | sed "s/$(echo -e '\015')//g"`

if [ "$HardAudioTest" = "yes" ];then
	while [ 1 ]
	do
		./playOrRecord -p audio/1KHz.pcm -s 8000 -f 0 -a 50
		sleep 5
	done
fi

sh $script_path/aging_test.sh
