File: wait-for-ll6.sh

package info (click to toggle)
ifupdown 0.8.19
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 896 kB
  • ctags: 250
  • sloc: ansic: 2,432; sh: 715; perl: 508; makefile: 89
file content (18 lines) | stat: -rw-r--r-- 336 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

attempts=${IF_LL_ATTEMPTS:-60}
delay=${IF_LL_INTERVAL:-0.1}

for attempt in $(seq 1 $attempts); do
	lladdress=$(ip -6 -o a s dev "$IFACE" scope link -tentative)
	if [ -n "$lladdress" ]; then
		attempt=0
		break
	fi
	sleep $delay
done

if [ $attempt -eq $attempts ]; then
	echo "Could not get a link-local address"
	exit 1
fi