Changeset 7b2dc2a8 in freewrt for package/fwifupdown/files
- Timestamp:
- Jun 28, 2007, 6:27:03 PM (18 years ago)
- Children:
- b3aae94e
- Parents:
- 14005bc
- File:
-
- 1 edited
-
package/fwifupdown/files/ifupdown.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
package/fwifupdown/files/ifupdown.sh
r14005bc r7b2dc2a8 6 6 # 7 7 # Christian Fischer <spaetzle@freewrt.org> 8 # Thorsten Glaser <tg@freewrt.org> 8 9 # 9 10 … … 35 36 36 37 # cleanup ifstate files 37 rm -rf /tmp/ifupdown/ifstate/* 38 rm -rf /tmp/ifupdown/ifstate 39 mkdir -p /tmp/ifupdown/ifstate 38 40 39 41 eval IFUPDOWN_ENV= $(grep '^FWIFUPDOWN_' /etc/rc.conf |sed "s/#.*//g") \ 40 42 busybox $what $@ $redirect 41 43 42 grep -q initialize /tmp/ifupdown/ifstate/bridge/* 2>&- || exit 0 43 44 mprint -n "Waiting for finishing bridge initialization" 45 46 while grep -rq initialize /tmp/ifupdown/ifstate/bridge/*; do 47 sleep 1 44 i=0 # did we print the initialisation message? 45 j=0 # timeout in seconds 46 rv=0 # exit status of this script 47 while sleep 1; do 48 if test $j -gt 15; then 49 mprint -s "bridge initialisation timed out" 50 rv=1 51 break 52 fi 53 for x in /tmp/ifupdown/ifstate/bridge/*; do 54 # any bridges to check? 55 test -e "$x" || break 2 # no -> out of both loops 56 # print initialisatio message, but once only 57 test $i = 1 || mprint -n \ 58 "Waiting for bridge initialisation to finish" 59 i=1 60 # check this bridge for its states 61 s=ok 62 for state in $(brctl showstp ${x##*/} | \ 63 fgrep state | sed "s/^.*state//"); do 64 test x"$state" = x"forwarding" && continue 65 # if only one is not forwarding, wait 66 s=no 67 break 68 done 69 test $s = ok || break # not ok? wait one second 70 rm -f $x # this bridge done, check next ones 71 done 72 j=$(eval $j + 1) 48 73 done 49 74 50 if grep -rq timeout /tmp/ifupdown/ifstate/bridge/*; then 51 mstate 1 52 mprint -s "bridge init: timeout" 53 exit 1 54 fi 55 mstate 0 75 mstate $rv 56 76 57 # vim:ts= 477 # vim:ts=8
Note:
See TracChangeset
for help on using the changeset viewer.
