#!/bin/sh
#
# This script prints everything engineering might need to debug a problem.
PATH=$PATH:/usr/local/bin
platform=$(cat /var/run/platform)

MAX_FILE_NUM=2
count=0
dump_file_content() {

	for n in $total_file
	do
		echo "cat $n"
		if [ -f "$n" ];then
			count=$((count+1))
			cat $n
		else
			echo "$n doesn't exist"
		fi
		if [ $count -ge $MAX_FILE_NUM ] ; then
			break
		fi
	done
}


if [ "$platform" = "RazorM" ]; then

echo "ls -lt /var/log/acp"
ls -lt /var/log/acp/* | awk '{print $5, $6,$7,$8,$9}'
file1=$(ls -t /var/log/acp/*)

echo "ls -lt /mnt/logs/acp/"
ls -lt /mnt/logs/acp/* | awk '{print $5, $6,$7,$8,$9}'
file2=$(ls -t /mnt/logs/acp/acp_messages*)

total_file="$file1 $file2"
dump_file_content

fi
exit 0
