#!/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} ixcpolicy list | \
while read polno inif vlan intype inip outtype outip ftype pkts state mirror cachestate cacheid cache type others 
do
	if [ ${firstelem} -eq 1 ]; then
		printf "{'id':'${polno}','pkts':'${pkts}'}"
		firstelem=0
	else
		printf ",{'id':'${polno}','pkts':'${pkts}'}"
	fi
done
echo "]"

echo -n "
";