#!/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)$(cat /tmp/region-setted)
info_get_acname=$(cat /module_name)
if [ "$info_get_acname" = "XAVN2001" ];then
info_get_acname="XAVN2001"
fi
info_get_hardware=$(cat /hardware_version)
#lan parameters
info_get_ipaddr=$($nvram get repeater_ip)
info_get_netmask=$($nvram get lan_netmask)
info_get_gateway=$($nvram get lan_gateway)
info_get_landhcp=$($nvram get lan_dhcp)
lan_hwifname=$($nvram get true_lanif)
#wan parameters
info_get_lanmac=$(ifconfig $lan_hwifname | 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})
info_get_channel=$($nvram get wl_channel)
if [ "$info_get_channel" = "0" ];then
info_get_channel=`iwpriv wlan0 get_mib channel | cut -b 28-29`
fi
info_get_mode=$(show_mode $gmode)
info_get_security=$($nvram get wl_sectype)
info_get_endis_wl_radio=$($nvram get endis_wl_radio)
info_get_ssid_broadcast=$($nvram get endis_ssid_broadcast)
wds_client_mac=`nvram get basic_station_mac | sed -n 's/://gp'`
wds_info=`cat /proc/wlan0/sta_info | grep -i $wds_client_mac | awk '{print $2}'`
if [ "x$wds_info" != "x" ];then
wds_tmp=$(cat /proc/wlan0/sta_info | sed -n "/$wds_info/{nnnnnnnnnnnnn;p;}" | awk '{print $3}')
if [ "x$wds_tmp" != "x" ]; then
cat /proc/wlan0/sta_info | sed -n "/$wds_info/{nnnnnnnnnnnnn;p;}" | awk '{print $3}' > /tmp/wds_info
else
cat /proc/wlan0/sta_info | sed -n "/$wds_info/{nnnnnnnnnnnnn;p;}" | awk '{print $2}' > /tmp/wds_info
fi
cat /proc/wlan0/sta_info | sed -n "/$wds_info/{nnnnnnnn;p;}" | awk '{print $2}' >> /tmp/wds_info
else
echo "0 0" > /tmp/wds_info
fi
link_rate=$(echo -n $(cat /tmp/wds_info) | awk '{print $1}')
rssi=$(echo -n $(cat /tmp/wds_info) | awk '{print $2}')
idle_time=`cat /proc/wlan0/sta_info | grep idle_time | awk '{print $2}'`
rm -f /tmp/wds_info
print_cgi_header
print_http_header "/funcs.js"
print_noload_header "_info"
print_table_header ""
cat <
${info_get_acname}
-->
${info_get_hardware}
${info_get_version}
$info_get_lanmac
${info_get_ipaddr}
EOF
wlan_get_ssid=$($nvram get wl_ssid | sed -e 's/\\/\\\\/g' -e 's/\"/\\\"/g' )
echo "
$info_get_country
$(show_channel $info_get_channel $gmode)
$info_get_mode
Wireless AP
$(show_on_off $info_get_endis_wl_radio)
$(show_on_off $info_get_ssid_broadcast)
EOF
print_http_footer