#!/bin/sh . /www/cgi-bin/functions.sh . /www/cgi-bin/language.sh lock_cgiwait . /www/cgi-bin/info.sh info_get_hardware=$(cat /hardware_version) info_get_version=$(cat /firmware_version)$(cat /firmware_region) 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 if [ "$($nvram get wl_mode)" = "3" ]; then if [ "$info_get_channel" -gt "4" ]; then sec_ch=$(($info_get_channel-4)) info_get_channel="$info_get_channel(P)+$sec_ch(S)" else sec_ch=$(($info_get_channel+4)) info_get_channel="$info_get_channel(P)+$sec_ch(S)" fi elif [ "$($nvram get wl_channel)" = "0" ]; then info_get_channel="auto($info_get_channel)" fi gmode=$($nvram get wl_mode) info_get_mode=$(show_mode $gmode) lan_ifname=$($nvram get lan_ifname) wan_ifname=$($nvram get wan_hwifname) info_get_lanmac=$(ifconfig $lan_ifname | sed -n 1p | awk '{ print $5 }') info_get_wanmac=$($ifconfig $wan_ifname | grep $wan_ifname | sed 's/.*HWaddr//') if [ "x$info_get_wanmac" = "x" ];then info_get_wanmac="----" fi info_get_wpspin=$($nvram get wps_pin) security_mode=$($nvram get wl_sectype) if [ $security_mode -eq 2 ]; then info_get_securitymode="WEP" key_no=$($nvram get wl_key) case "$key_no" in 1) info_get_passphrase="$(nvram get wl_key1)" ;; 2) info_get_passphrase="$(nvram get wl_key2)" ;; 3) info_get_passphrase="$(nvram get wl_key3)" ;; 4) info_get_passphrase="$(nvram get wl_key4)" ;; *) exit 1 esac elif [ $security_mode -eq 3 ]; then info_get_securitymode="WPA-PSK" wpa1_pwd=$($nvram get wl_wpa1_psk) info_get_passphrase="$wpa1_pwd" elif [ $security_mode -eq 4 ]; then info_get_securitymode="WPA2-PSK" wpa2_pwd=$($nvram get wl_wpa2_psk) info_get_passphrase="$wpa2_pwd" elif [ $security_mode -eq 5 ]; then info_get_securitymode="WPA-PSK-Mixed" wpa1wpa2_pwd=$($nvram get wl_wpas_psk) info_get_passphrase="$wpa1wpa2_pwd" else info_get_securitymode="NONE" info_get_passphrase="" fi print_cgi_header print_http_header cat < Hardware Version : $info_get_hardware
Firmware Version : $info_get_version
Wireless SSID : EOF wlan_get_ssid=$($nvram get wl_ssid | sed -e 's/\\/\\\\/g' -e 's/\"/\\\"/g' -e 's/" echo "var ssid=\"$wlan_get_ssid\";" cat <') new_ssid+='>'; else if(ssid.substring(i,i+1)=='<') new_ssid+='<'; else new_ssid+=ssid.substring(i,i+1); new_ssid=new_ssid.replace(/ /g," "); document.write(new_ssid);
Wireless Region : $info_get_country
Wireless Channel : $info_get_channel
Wireless Data rate : $info_get_mode
WAN MAC : $info_get_wanmac
LAN MAC : $info_get_lanmac
WPS Pincode : $info_get_wpspin
Wireless security : $info_get_securitymode
Wireless passphrase : $info_get_passphrase
EOF print_http_footer