[Lunar-commits] <lunar> Check for interface state earlier in "ip link" string

Stefan Wold ratler at lunar-linux.org
Sun Jan 6 20:40:22 CET 2013


commit ffbd55c86b94b983771a1881838ebcbd6a94abcf
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Sun, 06 Jan 2013 11:40:22 -0800
URL: https://github.com/lunar-linux/lunar/commit/ffbd55c86b94b983771a1881838ebcbd6a94abcf

Check for interface state earlier in "ip link" string
---
  libs/connect.lunar | +2/-2     
  1 file changed, 2 insertions(+), 2 deletions(-)

--- a/libs/connect.lunar
+++ b/libs/connect.lunar
@@ -37,14 +37,14 @@ connect()  {
   local TIMEOUT
   debug_msg "connect ($@)"
 
-  if ! ip link | egrep -q '^[0-9]*: (eth|wlan|ppp|ath|tun|ra|usb|br)[0-9]+.*state UP'
+  if ! ip link | egrep -q '^[0-9]*: (eth|wlan|ppp|ath|tun|ra|usb|br)[0-9]+[^>]*[<,]UP[,>]'
   then
     pon
 
     # Timeout in deciseconds to wait for Interface to come up.
     TIMEOUT=30
 
-    until ip link | egrep -q '^[0-9]*: (eth|wlan|ppp|ath|tun|ra|usb|br)[0-9]+.*state UP' || [ $TIMEOUT == 0  ]
+    until ip link | egrep -q '^[0-9]*: (eth|wlan|ppp|ath|tun|ra|usb|br)[0-9]+[^>]*[<,]UP[,>]' || [ $TIMEOUT == 0  ]
     do
       sleep  10
       (( TIMEOUT-- ))




More information about the Lunar-commits mailing list