#19116: "/lib/functions/network.sh; network_get_device" returns empty
-----------------------+-----------------------------------
  Reporter:  n0nb@…    |      Owner:  developers
      Type:  defect    |     Status:  new
  Priority:  normal    |  Milestone:
 Component:  packages  |    Version:  Barrier Breaker 14.07
Resolution:            |   Keywords:
-----------------------+-----------------------------------

Comment (by n0nb@…):

 Replying to [comment:2 Nilfred]:
 > Worksforme
 > {{{
 > . /lib/functions/network.sh; if network_get_device if_wan wan; then echo
 $if_wan; fi
 > pppoe-wan
 > }}}

 Now, this does work and returns the correct device, `eth0.2` in the case
 of my router.  Hmmmm.

 > Try this:
 > {{{
 > . /lib/functions/network.sh; if network_is_up wan; then echo WAN is up;
 else echo WAN is down; fi
 > }}}

 That works as well, returning "`WAN is up`".

 After a bit more testing, the original command I reported on is working
 fine.  I originally had tried the command when I was setting up the router
 and the WAN port was not connected to a network.  Now that it is on line
 the command works, so the caveat is that the function can only report the
 interface when it is active.

 My apologies for wasting everyone's time.  This report may be closed.  I
 will link to this in my forum post and may add a note to the Wiki recipe
 page.

 Thanks, Nate.

--
Ticket URL: <https://dev.openwrt.org/ticket/19116#comment:4>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to