#!/bin/sh . /www/cgi-bin/functions.sh lock_cgiwait lan_get_ip=$(nvram get lan_ipaddr) lan_get_netmask=$($nvram get lan_netmask) qos_su_ip=$(nvram get qos_su_ip) qos_enable_su=$(nvram get qos_enable_su) model=`cat /vendor_model_name` #echo "" > /tmp/netscan/ip_name_list #/usr/sbin/dev-scan $(nvram get auth_ip) #tmp=$(cat /tmp/netscan/ip_name_list) #[ "$tmp" = "" ] && tmp="unknown" #link_name=`echo $tmp | cut -d ' ' -f 2` #link_mac=$($nvram get auth_mac) #link_use_mac=`echo $link_mac | awk -F: '{print $4 $5 $6}'` #link_policy="Pri_MAC_$link_use_mac" #$nvram set qos_mac_list0="$link_policy 2 $link_name $link_mac" killall -SIGUSR1 udhcpd sleep 2 killall -SIGUSR2 net-scan #update dhcpd lease sleep 1 killall -SIGUSR1 net-scan mode=$(nvram get wl_mode) endis_wl_wmm=$($nvram get endis_wl_wmm) qos_endis_on=$($nvram get qos_endis_on) qos_endis_bandwidth=$($nvram get qos_threshold) qos_uprate=$($nvram get qos_uprate) qos_uprate_det=$($nvram get qos_uprate_det) qos_width=$($nvram get qos_width) qos_auto_bandwidth=$($nvram get qos_auto_bandwidth) qos_bw_mode=$(nvram get qos_bw_mode) if [ "x$qos_auto_bandwidth" = "x1" ];then [ -f /tmp/detec_uprate ] && check_qos_uprate=$(cat /tmp/detec_uprate) || check_qos_uprate=0 fi $nvram set qos_auto_bandwidth="0" oc $nvram commit 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 print_cgi_header print_http_header "/funcs.js" "/qos.js" print_body_header "_qos" "qos.html" "" print_table_header "" cat < var qos_width="$qos_width"; var lan_ip="$lan_get_ip" var lan_subnet="$lan_get_netmask" var qos_su_ip="$qos_su_ip" var qos_enable_su="$qos_enable_su" var qos_uprate=parseInt("$qos_uprate"); var qos_auto_bandwidth="$qos_auto_bandwidth"; var qos_bw_mode="$qos_bw_mode"; var qos_uprate_det="$qos_uprate_det" var check_qos_uprate="$check_qos_uprate"; var model="$model" function loadvalue() { cf=document.forms[0]; if('$mode' != '1' ) { cf.wmm_enable.disabled=true; cf.wmm_enable.checked = true; } else { if("$endis_wl_wmm"=="1") cf.wmm_enable.checked = true; else cf.wmm_enable.checked = false; } if("$qos_endis_on"=="1") cf.qosEnable.checked =true; else cf.qosEnable.checked = false; if ( "$qos_auto_bandwidth" == "2" ) { alert(qos_wrong_wanip); } if("$qos_endis_bandwidth" == "1") cf.turn_qos_bandwidth_on.checked = true; else cf.turn_qos_bandwidth_on.checked = false; if( "$qos_bw_mode" == "0" ) { cf.bw_mode[0].checked = true; } else { cf.bw_mode[1].checked = true; } if ( qos_width == "Mbps") { cf.qos_uprate_web.value = parseInt(qos_uprate/1024); cf.qos_width.selectedIndex=1; } else { cf.qos_uprate_web.value = qos_uprate; cf.qos_width.selectedIndex=0; } if ("$qos_auto_bandwidth" == "1" ) { if(check_qos_uprate == "0" || check_qos_uprate == "") { qos_uprate_det = 256; alert(qos_check_no_respone); } else { qos_uprate_det = check_qos_uprate; } qos_width = "Kbps"; } cf.uprate_det.value = qos_uprate_det; document.getElementById('qos_uprate_det').innerHTML = qos_uprate_det; show_suip(); if("$qos_enable_su"=="0") { cf.su_enable.checked = false; cf.su_IPAddress4.disabled=true; cf.su_IPAddress4.value=""; } else { cf.su_enable.checked = true; cf.su_IPAddress4.disabled=false; var trusted_array=new Array(); trusted_array=qos_su_ip.split('.'); cf.su_IPAddress4.value=trusted_array[3]; } } function check_auto_bandwidth() { cf=document.forms[0]; cf.submit_flag.value="qos_uplink_bandwidth"; cf.submit(); } EOF if [ "$model" = "JWNB2100-1ZGNLS" ]; then cat < EOF fi cat < EOF if [ "$model" != "JWNB2100-1ZGNLS" ]; then cat < . . . EOF fi cat < --> EOF print_http_footer