#!/bin/sh
. /www/cgi-bin/functions.sh
if [ -f /tmp/lock_show_refreshpage ];then
lock_cgiwait_show
fi
info_get_ip=$($nvram get lan_ipaddr)
info_get_mask=$($nvram get lan_netmask)
info_get_gateway=$($nvram get lan_gateway)
if [ "x$info_get_ip" = "x" -o "$info_get_ip" = "0.0.0.0" ];then
info_get_mask="0.0.0.0"
info_get_gateway="0.0.0.0"
fi
dhcpc_lease_obtain=$(cat /tmp/configs/dhcpc_lease_obtain)
if [ "x$dhcpc_lease_obtain" != "x" ];then
dhcpc_old_time=`echo $dhcpc_lease_obtain | awk '{print $4}'`
else
dhcpc_old_time="--"
fi
dhcpc_lease_time=$(cat /tmp/configs/dhcpc_lease_time)
now_dhcp_server=$(cat /tmp/configs/wan_dhcp_server)
if [ "x$now_dhcp_server" = "x" ];then
now_dhcp_server="0.0.0.0"
fi
#uptime
if [ -f /tmp/resolv.conf ];then
info_get_dns1=$(cat /tmp/resolv.conf | awk '/nameserver/{printf $2 "\n"}' | sed -n 1p)
info_get_dns2=$(cat /tmp/resolv.conf | awk '/nameserver/{printf $2 "\n"}' | sed -n 2p)
else
info_get_dns1="0.0.0.0"
info_get_dns2="0.0.0.0"
fi
if [ "x$info_get_ip" = "x" ];then
info_get_ip="0.0.0.0"
fi
if [ "x$info_get_ip2" = "x" ];then
info_get_ip2="0.0.0.0"
fi
if [ "$info_get_ip" = "0.0.0.0" ];then
now_dhcp_server="0.0.0.0"
fi
if [ "$info_get_dns1" = "$info_get_dns2" ];then
info_get_dns2=""
fi
print_cgi_header
print_http_header "/funcs.js"
echo ""
print_nobody_header "mul_connect_status.html" "connect_status"
print_table_header ""
cat <
EOF
print_http_footer_show