Changeset 2992


Ignore:
Timestamp:
2006-01-16T03:54:34+01:00 (12 years ago)
Author:
nbd
Message:

change pp{tp,poe}_ifname to wan_device and add some code to webif and S05nvram so that it automagically gets the whole wan_ifname stuff right without screwing up weird custom settings

Location:
branches/whiterussian/openwrt/package
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/whiterussian/openwrt/package/base-files/default/etc/init.d/S05nvram

    r2507 r2992  
    105105                nvram set wan_ifname="none" 
    106106        ;; 
     107        *) 
     108                # wl-500g defaults. these are placed here, because WL-HDD and WL-300g 
     109                # might have the same nvram settings. 
     110                [ "$(nvram get boardnum)" = "asusX" \ 
     111                -a "$(nvram get boardtype)" = "bcm94710dev" ] && { 
     112                        nvram_default wan_device "eth1" 
     113                } 
     114        ;; 
    107115esac 
    108116 
     
    128136} 
    129137 
    130 WAN_PROTO="$(nvram get wan_proto)" 
    131 [  "$WAN_PROTO" = "pptp" \ 
    132 -o "$WAN_PROTO" = "pppoe" ] && { 
    133         WAN_IFNAME="$(nvram get wan_ifname)" 
    134         [ "${WAN_IFNAME%%[0-9]*}" = "ppp" ] || { 
    135                 nvram set wan_ifname=ppp0 
    136                 nvram set ${WAN_PROTO}_ifname="$WAN_IFNAME" 
    137         } 
    138 } 
    139  
    140138# defaults 
    141139nvram_default lan_ifname "br0" 
     
    143141 
    144142nvram_default wan_ifname "vlan1" 
     143nvram_default wan_device "vlan1" 
    145144nvram_default wan_proto "dhcp" 
    146145 
     
    150149nvram_default wl0_radio 1 
    151150 
     151WAN_PROTO="$(nvram get wan_proto)" 
     152WAN_IFNAME="$(nvram get wan_ifname)" 
     153case "$WAN_PROTO" in 
     154        pp*) [ "${WAN_IFNAME%%[0-9]*}" = "ppp" ] || nvram set wan_ifname=ppp0;; 
     155        *) [ "${WAN_IFNAME%%[0-9]*}" = "ppp" ] && nvram set wan_ifname="$(nvram get wan_device)";; 
     156esac 
     157 
    152158[ "$(nvram get il0macaddr)" = "00:90:4c:5f:00:2a" ] && { 
    153159        # if default wifi mac, set two higher than the lan mac 
  • branches/whiterussian/openwrt/package/base-files/default/sbin/ifup

    r1854 r2992  
    77if_proto=$(nvram get ${type}_proto) 
    88if=$(nvram get ${type}_ifname) 
    9 [ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${if_proto}_ifname) 
     9[ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${type}_device) 
    1010 
    1111if_valid $if || [ "$if_proto" = "pptp" ] || exit  
  • branches/whiterussian/openwrt/package/ppp/files/ifup.pppoe

    r2939 r2992  
    1414 
    1515(while :; do 
    16         IFNAME=$(nvram get pppoe_ifname) 
     16        IFNAME=$(nvram get wan_device) 
    1717        USERNAME=$(nvram get ppp_username) 
    1818        PASSWORD=$(nvram get ppp_passwd) 
  • branches/whiterussian/openwrt/package/pptp/files/ifup.pptp

    r2618 r2992  
    3535        # hack for some buggy ISPs 
    3636        NETMASK=$(nvram get ${type}_netmask) 
    37         IFNAME=$(nvram get pptp_ifname) 
     37        IFNAME=$(nvram get wan_device) 
    3838        [ -z "$NETMASK" -o -z "$IFNAME" ] || ifconfig $IFNAME netmask $NETMASK 
    3939 
  • branches/whiterussian/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh

    r2881 r2992  
    9494 
    9595                                save_setting network wan_ifname "ppp0" 
    96                                 save_setting network pptp_ifname "vlan1" 
    97                                 save_setting network pppoe_ifname "vlan1" 
    9896                 
    9997                                case "$FORM_ppp_redial" in 
     
    107105                        ;; 
    108106                        *) 
    109                                 save_setting network wan_ifname "vlan1" 
     107                                wan_ifname=${wan_ifname:-$(nvram get wan_ifname)} 
     108                                [ -z "$wan_ifname" -o "${wan_ifname%%[0-9]*}" = "ppp" ] && { 
     109                                        wan_device=${wan_device:-$(nvram get wan_device)} 
     110                                        wan_device=${wan_device:-vlan1} 
     111                                        save_setting network wan_ifname "$wan_device" 
     112                                } 
    110113                        ;; 
    111114                esac 
Note: See TracChangeset for help on using the changeset viewer.