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

"
echo -n "";
. ../common/common.sh
 
myself="/cgi-bin/Maintain/`basename $0`"
ignore_dns=0

echo -n "
<script type=\"text/javascript\" src=\"/img/common.js\"></script>
";

if [ "${REQUEST_METHOD}" = "POST" ]; then
	operator_check "${myself}"
  
  if [ "${CGI_icmp_value}" != "" ]; then

      errmsg=`${FLOWEYE} nat config icmp_echoproxy=${CGI_icmp_value}`
      if [ $? -eq 0 ]; then
          afm_dialog_msg "ɹ!"
          afm_load_page 0 "${myself}"
          exit 0
      fi
      afm_dialog_msg "ִ:${errmsg}" 
  fi
fi

icmp_value=`${FLOWEYE} nat stat | grep icmp_echoproxy= | cut -d'=' -f2 | awk -F '-' '{printf $1/1000"-"$2/1000}'`

echo -n "
<body>
"; cgi_show_title "߼-->pingֵ޸" 

echo -n "
<br>
<form method=post onsubmit=\"return beforeCommit(this)\" action=\"${myself}\">
<table width=700 border=0 cellspacing=0 cellpadding=3 bgcolor=\"#ffffff\">
<tr id=row1>
        <td style=\"width:20\"></td>
        <td align=left style=\"width:110\">pingֵ</td>
        <td align=left width=*><input type=text name=icmp_value value=\"${icmp_value}\" style=\"width:60\"></input>
                ms (ʾ2-5msʾpingֵ޸ĳ25֮䣻0-0ʾ޸ġ)</td>
</tr>
</table>
<table style=\"width:700; border-bottom:1px #787882 solid; color:#0000ff\">
<tr><td align=right>&nbsp;</td></tr>
</table>
<table style=\"width:700\"> 
<tr>
        <td align=right>
                <input type=submit style=\"width:80\" value=\"ύ\"></input>
        </td>
</tr>
</table>
</form>
</body>
</html>
";

