Assembla home | Assembla project page
 

Changeset 33

Show
Ignore:
Timestamp:
09/01/07 04:34:19 (1 year ago)
Author:
evdowizard
Message:

add webif connect on demand status

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/imagebuilder/files/www/cgi-bin/webif/status-wwaninfo.sh

    r18 r33  
    2828ifconfig |grep ppp0 >>/dev/null 
    2929if [ $? = 0 ]; then 
    30 ip=$(/sbin/ifconfig ppp0 | grep inet | awk '{print $2}'| awk -F : '{print $2}') 
    31 rx=$(/sbin/ifconfig ppp0 | grep 'RX bytes' | awk -F : '{print $2}' | awk -F' T' '{print $1}') 
    32 tx=$(/sbin/ifconfig ppp0 | grep 'RX bytes' | awk -F : '{print $3}') 
    33 resconf=$(cat /etc/dnsmasq.conf 2>/dev/null | grep "^resolv-file=" | cut -d'=' -f 2) 
    34 resconf="${resconf:-"/etc/resolv.conf"}" 
    35 dns_servers=$(cat "$resconf" 2>/dev/null | awk 'BEGIN{ dns_count=0 }; /nameserver/ { dns_count++; print "field|@TR<<DNS Server>> " dns_count "|dns_server_" dns_count; print "string|" $2 }') 
     30       ip=$(/sbin/ifconfig ppp0 | grep inet | awk '{print $2}'| awk -F : '{print $2}') 
     31       rx=$(/sbin/ifconfig ppp0 | grep 'RX bytes' | awk -F : '{print $2}' | awk -F' T' '{print $1}') 
     32       tx=$(/sbin/ifconfig ppp0 | grep 'RX bytes' | awk -F : '{print $3}') 
     33       resconf=$(cat /etc/dnsmasq.conf 2>/dev/null | grep "^resolv-file=" | cut -d'=' -f 2) 
     34       resconf="${resconf:-"/etc/resolv.conf"}" 
     35       dns_servers=$(cat "$resconf" 2>/dev/null | awk 'BEGIN{ dns_count=0 }; /nameserver/ { dns_count++; print "field|@TR<<DNS Server>> " dns_count "|dns_server_" dns_count; print "string|" $2 }') 
    3636fi 
    3737 
     
    5151case "$(cat /proc/diag/led/3g_blink)" in 
    52521) 
    53 status="@TR<<Connecting>>" 
    54 action="@TR<<Disconnect>>" 
    55 if_action="ifdown" 
     53       status="@TR<<Connecting>>" 
     54       action="@TR<<Disconnect>>" 
     55       if_action="ifdown" 
    5656;; 
    57570) 
    58 case "$(cat /proc/diag/led/3g_blue)" in 
    59 1) 
    60 status="@TR<<Connected>>" 
    61 action="@TR<<Disconnect>>" 
    62 if_action="ifdown" 
    63 hideinfo= 
    64 ;; 
    65 0) 
    66 status="@TR<<Disconnected>>" 
    67 action="@TR<<Connect>>" 
    68 if_action="ifup" 
    69 ;; 
    70 esac 
     58        case "$(cat /proc/diag/led/3g_blue)" in 
     59        1) 
     60                status="@TR<<Connected>>" 
     61                action="@TR<<Disconnect>>" 
     62                if_action="ifdown" 
     63                hideinfo= 
     64        ;; 
     65        0) 
     66                case "$(cat /proc/diag/led/3g_green)" in 
     67                1) 
     68                        status="@TR<<Connect on Demand>>" 
     69                ;; 
     70                0) 
     71                        status="@TR<<Disconnected>>" 
     72                        action="@TR<<Connect>>" 
     73                        if_action="ifup" 
     74                ;; 
     75                esac 
     76        esac 
    7177;; 
    7278esac