Changeset 10751


Ignore:
Timestamp:
2008-04-07T03:07:50+02:00 (9 years ago)
Author:
nbd
Message:

fix the route to the pptp server when using pptp as wan interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/pptp/files/pptp.sh

    r10367 r10751  
    22        scan_ppp "$@" 
    33} 
     4 
     5find_gw() { 
     6        route -n | awk '$1 == "0.0.0.0" { print $2; exit }' 
     7} 
     8 
    49 
    510setup_interface_pptp() { 
     
    914        config_get device "$config" device 
    1015        config_get ipproto "$config" ipproto 
     16        config_get server "$cfg" server 
    1117 
    1218        for module in slhc ppp_generic ppp_async ip_gre; do 
     
    1622 
    1723        setup_interface "$device" "$config" "${ipproto:-dhcp}" 
     24        local gw="$(find_gw)" 
     25        [ -n "$gw" ] && { 
     26                route delete "$server" 2>/dev/null >/dev/null 
     27                route add "$server" gw "$gw" 
     28        } 
    1829 
    1930        # fix up the netmask 
     
    2738 
    2839        config_get mtu "$cfg" mtu 
    29         config_get server "$cfg" server 
    3040        mtu=${mtu:-1452} 
    3141        start_pppd "$config" \ 
Note: See TracChangeset for help on using the changeset viewer.