Commit 81ece45c authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Thomas Petazzoni
Browse files

Revert "package/initscripts: S40network: wait for network interfaces to appear"



This reverts commit 49964858. It is
going to be replaced with an ifup hook in next patch.

Signed-off-by: default avatarJérôme Pouiller <jezz@sysmic.org>
Acked-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 0338272f
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
@@ -6,37 +6,8 @@
# Debian ifupdown needs the /run/network lock directory
mkdir -p /run/network

# In case we have a slow-to-appear interface (e.g. eth-over-USB),
# and we need to configure it, wait until it appears, but not too
# long either. WAIT_DELAY is in seconds.
WAIT_DELAY=15

wait_for_interfaces() {
	IFACES=$(awk '/^auto/ { print $2 }' /etc/network/interfaces)
	[ -n "$IFACES" ] || return

	printf "Waiting for network interfaces to appear"

	for i in $(seq $WAIT_DELAY); do
	    for IFACE in $IFACES; do
		if [ ! -e "/sys/class/net/$IFACE" ]; then
		    printf "."
		    sleep 1
		    continue 2
		fi
	    done

	    printf " ok\n"; return
	done

	printf " timeout\n"
	exit 1
}

case "$1" in
  start)
	wait_for_interfaces

 	echo "Starting network..."
	/sbin/ifup -a
	;;