12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- timeout=30
- (
- for n in $(seq 1 $timeout); do
- # If there is an IPv4 default route, stop waiting
- if ip -4 route | grep -q "^default"; then
- break
- fi
- sleep 1
- done
- )&
- (
- for n in $(seq 1 $timeout); do
- # If there is an IPv6 default route, stop waiting
- if ip -6 route | grep -q "^default"; then
- break
- fi
- sleep 1
- done
- )&
- (
- for n in $(seq 1 $timeout); do
- # If there is an IPv6 in state tentative, wait on
- if ip -6 addr | grep -q "tentative"; then
- sleep 1
- else
- break
- fi
- done
- )&
- wait
- exit 0
|