* Jonathan Bennett <[email protected]> [02.08.2013 15:22]:
> >  +# The following line is changed specifically for Openwrt.
> >  +# Openwrt defaults to using eth1 as its wan port. If using PPPoE,
> >  +# Then this needs to be set to pppoe-wan.
> >  +
> >  +PCAP_INTF                   eth1;

nobody will commit this.
there is no easy way to detect

a)
is there any wan port?

b)
which wan (if there is more than one) you want to use

you can "guess" your wan during first run via something like.

get_wandev()
{
        local wandev

        # e.g.
        # 0.0.0.0  10.63.76.1  0.0.0.0  UG  2  0  0 wlan0-1

        set -- $( route -n | grep ^'0\.0\.0\.0' | head -n1 )
        while [ -n "$1" ]; do wandev="$1"; shift; done          # lastword

        echo "wandev"
}

but this is not 100% - any other suggestions?

best would be to write a wrapper, which takes uci-vars and builds a
correct config for you program out of this.

bye, bastian
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to