aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/dad.if-up
blob: 7903822c8fd25941ea82c12b30ec7a90bf5b710b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

# Block ifup until DAD completion
# Copyright (c) 2016-2018 Kaarle Ritvanen

has_flag() {
	ip address show dev $IFACE up | grep -q " $1 "
}

counter=100
while [ "$counter" -gt 0 ] &&
	has_flag tentative &&
	! has_flag dadfailed; do
	sleep 0.2
	counter=$((counter - 1))
done