#!/bin/sh
. /www/cgi-bin/functions.sh
. /www/cgi-bin/language.sh
lock_cgiwait
. /www/cgi-bin/info.sh
gmode=$($nvram get wl_mode)
#fireware version
info_get_version=$(cat /firmware_version)
if [ "$info_get_version" != "WW" ];then
info_get_version=$info_get_version$(cat /tmp/region-setted)
fi
info_get_hardware=$(cat /hardware_version)
lan_ifname=$($nvram get lan_ifname)
#lan parameters
#info_get_ipaddr=$($nvram get lan_ipaddr)
info_get_ipaddr=$(ifconfig $lan_ifname | sed -n 2p | awk -F: '{print $2}' | awk '{print $1}')
info_get_netmask=$($nvram get lan_netmask)
#info_get_gateway=$($nvram get lan_gateway)
#info_get_landhcp=$($nvram get lan_dhcp)
info_get_lanmac=$(ifconfig $lan_ifname | sed -n 1p | awk '{ print $5 }')
#wireless parameters
info_get_ssid=$($nvram get wl_ssid)
country_code=$($nvram get wl_country)
#info_get_country=$(show_region ${country_code})
channel=$($nvram get wl_channel)
info_get_channel=$(show_channel $channel $gmode)
#info_get_mode=$(show_mode $gmode)
security=$($nvram get wl_sectype)
#info_get_security=$(show_enc $security)
info_get_endis_wl_radio=$($nvram get endis_wl_radio)
info_get_ssid_broadcast=$($nvram get endis_ssid_broadcast)
wps_status=$($nvram get wps_status)
#info_get_wps_status=$(show_wps $wps_status)
wlan_get_ssid=$($nvram get wl_ssid | sed -e 's/\\/\\\\/g' -e 's/\"/\\\"/g' -e 's/\//\\\//g')
print_cgi_header
print_http_header "/funcs.js"
print_noload_header "_info"
print_table_header ""
cat <
${info_get_hardware}
${info_get_version}
$info_get_lanmac
${info_get_ipaddr}
${info_get_netmask}
${info_get_channel}
EOF
print_http_footer