#!/bin/sh
#This script is created by ssparser automatically. The parser first created by MaoShouyan
printf "Content-type: text/html;charset=gb2312
Cache-Control: no-cache

"
echo -n "";
if [ -f ${RAMDISK}/PG.conf ]; then
        . ${RAMDISK}/PG.conf
        PGPATH="${RAMDISK}"
else
        . /etc/PG.conf
fi
FLOWEYE=${PGPATH}/bin/floweye
firstelem=1
printf "["
${FLOWEYE} route list | while read id iniftype inifname proto appid appname \
srctype srcip srcport dsttype dstip dstport dscp disabled vlan action nexthop gateway state pkts theothers
do
	if [ ${firstelem} -eq 1 ]; then
		printf "{ 'id':'${id}','pkts': '${pkts}'}"
		firstelem=0
	else
		printf ",{ 'id':'${id}','pkts': '${pkts}'}"
	fi
done
echo "]"

echo -n "
";