Bug#573007: NIC r8169 doesn t start at restart on kernel linux-image-2.6.32-trunk-686 (workaround)
- To: 573007@bugs.debian.org
- Subject: Bug#573007: NIC r8169 doesn t start at restart on kernel linux-image-2.6.32-trunk-686 (workaround)
- From: Florent Rougon <f.rougon@free.fr>
- Date: Sun, 28 Mar 2010 18:40:03 +0200
- Message-id: <871vf49z8c.fsf@zita.maison>
- Reply-to: Florent Rougon <f.rougon@free.fr>, 573007@bugs.debian.org
- In-reply-to: <87d3yo9ziv.fsf@zita.maison> (Florent Rougon's message of "Sun, 28 Mar 2010 18:33:44 +0200")
- References: <87d3yo9ziv.fsf@zita.maison>
Would be even better with the script actually attached...
--
Florent
#! /bin/bash
interfaces="eth0 eth1"
max_attempts=15
exit_status=1
for attempt in $(seq 1 $max_attempts); do
all_intf_ok=1
for intf in $interfaces; do
ifconfig $intf | grep >/dev/null "^[[:space:]]*inet addr:" \
|| { all_intf_ok=0; break; }
done
[ $all_intf_ok -eq 1 ] && { exit_status=0; break; }
echo "Ethernet interfaces not properly initialized." \
"Trying to fix that (attempt $attempt)..."
n=$(echo "($RANDOM % 3) + 2" | bc)
for i in $(seq 1 $n); do
modprobe -r r8169; modprobe r8169
done
ifdown -a "$@"
ifup -a "$@"
done
exit $exit_status
Reply to: