#!/bin/sh
. /www/cgi-bin/functions.sh
lock_cgiwait
#endis_telnet=$($nvram get endis_telnet)
endis_remote=$($nvram get remote_endis)
remote_access=$($nvram get remote_access)
remote_iplist=$($nvram get remote_iplist)
remote_port=$($nvram get remote_port)
lan_get_ip=$($nvram get lan_ipaddr)
lan_get_netmask=$($nvram get lan_netmask)
forward_totalnum=$($nvram show | grep ^forwarding | wc -l)
trigger_totalnum=$($nvram show | grep ^triggering | wc -l)
wan_status=$(cat /tmp/port_status)
#killall -17 upnp
upnp_totalnum=$( [ -f /tmp/upnp_portmap ] && cat /tmp/upnp_portmap | wc -l || echo 0)
info_get_wanproto=$($nvram get wan_proto)
if [ "$info_get_wanproto" = "dhcp" ];then
info_get_wanip=$($nvram get wan_dhcp_ipaddr)
elif [ "$info_get_wanproto" = "static" ];then
info_get_wanip=$($nvram get wan_ipaddr)
elif [ "$info_get_wanproto" = "bigpond" ];then
info_get_wanip=$($nvram get wan_dhcp_ipaddr)
elif [ "$info_get_wanproto" = "pppoe" -o "$info_get_wanproto" = "pptp" ];then
ppp0_value=`ifconfig | grep ^ppp0`
if [ "x$ppp0_value" != "x" ];then
info_get_wanip=`ifconfig ppp0 | sed 2p -n | awk '/inet/{print $2}' | awk -F: '{print $2}'`
fi
elif [ "$info_get_wanproto" = "mulpppoe1" ];then
IP_FILE0=/etc/ppp/pppoe1-ip
PPP0_STATUS=/etc/ppp/pppoe1-status
info_get_wanip="0.0.0.0"
if [ -f $PPP0_STATUS ]; then
status=$(cat $PPP0_STATUS)
if [ "x$status" = "x1" -a -f $IP_FILE0 ]; then
info_get_wanip=$(cat $IP_FILE0)
fi
fi
if [ "x$info_get_wanip" = "x" -o "$info_get_wanip" = "0.0.0.0" ];then
IP_FILE1=/etc/ppp/pppoe2-ip
PPP1_STATUS=/etc/ppp/pppoe2-status
info_get_wanip="0.0.0.0"
if [ -f $PPP1_STATUS ]; then
status=$(cat $PPP1_STATUS)
if [ "x$status" = "x1" -a -f $IP_FILE1 ]; then
info_get_wanip=$(cat $IP_FILE1)
fi
fi
fi
fi
if [ "x$info_get_wanip" = "x" ];then
info_get_wanip="0.0.0.0"
fi
endis_ntp=$($nvram get endis_ntp)
endis_upnp=$($nvram get upnp_enable)
print_cgi_header
print_http_header "/funcs.js" "/remote.js"
print_body_header "_FW_remote" "remote.html" "remote"
print_table_header ""
echo ""
cat <
var endis_ntp="$endis_ntp";
var endis_upnp="$endis_upnp";
var lan_ip="$lan_get_ip"
var lan_subnet="$lan_get_netmask"
var info_get_wanproto="$info_get_wanproto"
function loadvalue()
{
var cf = document.forms[0];
if('$endis_remote' == '1')
cf.remote_mg_enable.checked= true;
else
cf.remote_mg_enable.checked =false;
if('$remote_access' == '0')
{
cf.rm_access[0].checked = true;
if('$remote_iplist'!='')
var ipaddr = "$remote_iplist";
var ip_array=ipaddr.split('.');
cf.local_ip1.disabled = false;
cf.local_ip2.disabled = false;
cf.local_ip3.disabled = false;
cf.local_ip4.disabled = false;
cf.local_ip1.value=ip_array[0];
cf.local_ip2.value=ip_array[1];
cf.local_ip3.value=ip_array[2];
cf.local_ip4.value=ip_array[3];
}
else if('$remote_access' == '2')
{
cf.rm_access[2].checked = true;
clearData1();
}
else
{
cf.rm_access[1].checked = true;
if('$remote_iplist'!='')
var ipaddr = "$remote_iplist";
var ip_array=ipaddr.split('-');
var start_array=ip_array[0].split('.');
var end_array=ip_array[1].split('.');
cf.start_ip_1.value = start_array[0];
cf.start_ip_2.value = start_array[1];
cf.start_ip_3.value = start_array[2];
cf.start_ip_4.value = start_array[3];
cf.fin_ip_1.value = end_array[0];
cf.fin_ip_2.value = end_array[1];
cf.fin_ip_3.value = end_array[2];
cf.fin_ip_4.value = end_array[3];
clearData3();
}
//if('$endis_telnet'=='1')
// cf.enable_telnet.checked=true;
//else
// cf.enable_telnet.checked=false;
}
.
.
.
.
.
.
|
.
.
.
|
EOF
print_http_footer